Hi all. I am write simple Jira connector which allow me to talk with bot inside jira ticket using comments. Bot works fine. But my workflow in more complicated:
User create jira ticket with access request in ticket title or description (like asking to add some email to gitlab)
Bot recognize intent and ask about missing entities (I use form, works fine)
After submitting form bot ask security engineer to approve inviting new member to gitlab.
Here is problem. I use jira ticket id (or key like GTD-3345) as sender_id and recipient_id in connector. So, context == jira ticket.
Question is: how can I send additional info like comment author for verifying that exactly he approve inviting?
Possible solutions I found:
I can include comment author email as prefix inside each UserMessage text, like “some@gmail.com: comment text here”. But in this case bot will recognize email as entity each time. Also, all my intents will start from some name. Looks not quite right…
Add slot “comment_author” and extract it from each text message using regex feature, like ^([a-zA-Z.]+):. From this point one more question: how can I put “True” to slot “security_eng_approve” only if “comment_author” is pre-defined security eng and intent is “affirm”? Maybe I need to create one more form special for security eng approv?
but always receive error: Failed to extract slot security_eng_approve with action approve_form
It works if text recognized as just affirm intent, but now I always have comment intents. I need to extract affirm/deny from comment intent. Who know how to do this?
Ok, model evolved to simple: one approve_form with 4 required slots:
action
service
email
security_eng_approve
All slots required, and security_eng_approve slot validated as:
def validate_security_eng_approve(
self,
value: Text,
dispatcher: CollectingDispatcher,
tracker: Tracker,
domain: Dict[Text, Any],
) -> Optional[Text]:
approver = 'eduard' #pre-defined approver that should be taken from jira group
if tracker.get_slot('author') == approver and value is True:
dispatcher.utter_message("Thank you master {}!".format(approver))
return {"security_eng_approve": True}
else:
dispatcher.utter_message("I am trust only {}, sorry.".format(approver))
return {"security_eng_approve": None}
This is simple, but I still can’t extract intent from intent
But I still receive error Failed to extract slot security_eng_approve with action approve_form.
Not sure why I cant extract entity, in interactive learning I manually set text as comment intent, and specified [vladimir](author): [yes](affirm). affirm in domain, yes.
Failed to fill utterance template '{'text': '{security_eng}, please check it.'}'. Tried to replace 'security_eng' but could not find a value for it. There is no slot with this name nor did you pass the value explicitly when calling the template. Return template without filling the template.
Why it required to solve: When this text will be as comment in jira, target security engineer receive notification/mention.
Possible solutions:
programmatically add slot security_eng, and put required value to it. (still don’t know how to do this. Maybe need to add custom action after access_request only for setting slot programmatically, but I want to find is possible inside form or not. )
split approve_form to: access_request_form → action_ask_security_eng → approve_form. In this case from custom action I can do: dispatcher.utter_message("{} please approve".format(target_approver)).
hardcode it in domain file, but it’s absolutely bad idea
@akelad quick question here: do action server have health or status endpoint?
I want to put core and action servers to kubernetes and I need to define livenessProbe/readinessProbe.
In your Jira connector, if you need to send additional information like the comment author for verification, there are a couple of viable solutions. One approach is to include the comment author’s email as a prefix inside each UserMessage text. However, to prevent interference with entity recognition, consider using a unique separator like “@@” before the email. This way, you can extract the comment text without affecting your entity recognition process. Another option is to add a “comment_author” slot and extract it from each text message using a regex pattern like ^([a-zA-Z.]+):. This allows you to capture the comment author separately. To handle the security engineer’s approval, you might consider creating a dedicated form specifically for this purpose, ensuring that the “security_eng_approve” slot is set to “True” only if the “comment_author” is a pre-defined security engineer and the intent is “affirm.”