we have some automation that makes subtasks automatically from sent emails (from outlook). it works nice, subtasks are created in project, assigneees are set from description from email and also priority is set same way.
And now, we would like to extend this automation the way that from description string will be parent set in subtask. eg. email will contain string #PROJXY-123# and this subtask will set its parent to key PROJXY-123 (if exists).
is it possible ?
Juraj
Hi @Juraj -- Welcome to the Atlassian Community!
Without seeing the specifics of your issue Description's format, this is might be possible by:
However if the trigger issue is the already created subtask, you will need to experiment to learn if editing the parent will "move" the issue or if the REST API endpoint must be called from the rule to do so with the Send Web Request action.
Kind regards,
Bill
hi @Bill Sheboy , thanks for your answer. but... I am very junior in automation and do not understand your proposals. I will describe my situation better.
1. we prepare email with text in body "#juraj" and "#high" and send it to jira.development@....smthx...
2. automation creates sub-task in project eg. "Development" and set assignee to Juraj... and set priority to HIGH
3. but automation is not able to assign parent (TASK) automatically
we would like to teach automation, that if there is ParentID inside body of email (description), than automation sets parent for the subtast accordingly (eg. text in body "#PROJXY-123#" means that subtask should be assigned to parent with such issue ID)
i believe it is possible , but wonder how and hope is not too much difficult
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Please post an image of your entire rule in a single image for context. Thank you!
And something you describe puzzles me: normally Jira email handlers create an issue from the email. Do you instead have a rule triggered on Issue Created which is attempting to modify the issue?
Back to the scope of your original question, let us assume your Description contains the issue key somewhere in the text in that format, such as: #PROJXY-123#
That could be extracted and saved in a created variable using this expression:
{{issue.description.replace("\n", " ").split(" ").match("#([A-Z][A-Z0-9]++\-\d++)#").distinct}}
That works by:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
That expression may be used with the Create Variable action near the beginning of your rule: https://support.atlassian.com/cloud-automation/docs/jira-automation-actions/#Create-variable
With that, the resulting smart value could be used as the parent key. For example, if the name used in the variable action was varParentKey the parent could be set to {{varParentKey}}
You may want to add a condition to confirm a value was found.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
that's helping me to understand the point, thanks Bill . what I miss in this is , how to set Parent with variable. Shall I use "Edit Issue Filed" select Parent ... or some other way ?
sorry for that, maybe its stupid question..
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Bill, one more question. to make it more easy for my coleaques, I want them just to send NICK for parent and lookup table will do rest (you opened my eyes for these possibilties)
how to regex expression like this eg.
#CKV#
this does not work:
{{issue.description.replace("\n", " ").split(" ").match("#([A-Z0-9]++\b)#").distinct}}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
That value appears to be static text, and not variable like an issue key.
Do you mean the Description will contain #CKV# rather than the key and then that value will be used somehow to identify the correct issue?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi Bill, yes exactly.
I already made lookup table for that purpose. user can use Nick of parent in email description to identify parent and lookup table will send final parent issue key.
I think that only matter is how to write regex correctly as I did some mistake in my formula: {{issue.description.replace("\n", " ").split(" ").match("#([A-Z0-9]++\b)#").distinct}}
nick names will be like:
#CKV1# or #DIMS2# .... starting with string and ending with numeric value
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.