How can I notify the assignee when an issue is cloned from a project?

Phil Bustin
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 3, 2023

An automation clones an issue from a JSM project to a Jira Software project that is selected  from a field entered by the user, and adds the new issue to a sprint.  The automation also adds the new issue to sprints in various projects depending on conditions,  The automation is in the JSM project, but could be changed to global.

Can an notification component be added to each condition of the automation, sending an email to the assignee of the new Jira Software project?  If so, I haven't been able to figure out how.

Alternatively, can a global automation be created in Jira Software, with the trigger "Issue created" or "Value changes for Sprint", that sends the emails?

1 answer

1 accepted

0 votes
Answer accepted
Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 3, 2023

Hello @Phil Bustin 

Whenever asking for help concerning an existing Automation Rule it is vital that you share the full rule with us. We cannot advise you on the specifics of modifying a rule without seeing the details of the rule.

There is a Send Email action. You should be able to use it in your rule. 

Phil Bustin
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 3, 2023

Thank you.  When I sent an email (I should have mentioned), the {{issue.key}} was that of the JSM issue, not the cloned issue.

Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 3, 2023

If your rule is not doing what you want it to do you will need to post a copy of your rule for us to review. Often incorrect results have a lot to do with the context under which a step is executing. We can't advise you without seeing the details of the rule.

Phil Bustin
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 3, 2023

It was the end of the workday, so I deferred uploading a screenshot of the rule until now:

Automation

automation 5-3-23.jpg

Email received, containing the JSM issue key instead of the just-created Jira Software issue key

email 5-3-23.jpg

Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 3, 2023

I don't see the connection between the rule you posted and the scenario you described about an automation that runs against a JSM project and uses the Clone Issue action to make copies of the JSM issue in other projects. 

For the rule you posted the only issue within the context of the rule is the issue that triggered it, which is an issue that had its status changed Therefore the issue information available through the {{issue}} smart value will be the information of the trigger issue.

Phil Bustin
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 4, 2023

I apologize.  Here are the current automation and resulting email.  BTW, I came to the conclusion that although it may be possible with branching to send the desired email in this automation, what would likely work is a new automation with an issue created trigger.

Automation

automation 5-3-23.jpg

 

Email received

email 5-3-23.jpg

Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 4, 2023

In the context of the rule you have posted {{issue}} is still referencing the issue that triggered the rule. {{issue}} will change context when you go into a branch.

If you want to reference an issue created within a rule, you can use the {{createdIssue}} smart value to reference the last issue created in the rule. You may want to add a Re-Fetch Issue action before attempting to use the {{createdIssue}} smart value to ensure your rule has current data.

Phil Bustin
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 4, 2023

So you're confirming that I could try a branch in order to send an email to the Assignee of the created issue?

And if I did not use a branch, but used {{createdIssue}} to reference the last issue created, how would I address the email to the Assignee of the created issue?

Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 4, 2023

{{createdIssue}} is an object just like {{issue}}. You can access the same attributes in both. If the Assignee field has been set during the Clone step, then you can reference that field with {{createdIssue.assignee}}.

You don't need to use a branch to do that. I'm unclear what problem you would be trying to solve by using a branch.

Phil Bustin
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 4, 2023

No need to use a branch, with the answer you have provided.  Thanks!

Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 4, 2023

Happy to help.

If your question has been answered and your problem solved, please consider marking the Answer as Accepted to help other users find posts with validated solutions.

Phil Bustin
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 4, 2023

Thought I had done that. :-)

Phil Bustin
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 5, 2023

Still working on this, but it would appear that even though the assignee was set by me to myself in the Move to Dev Team transition screen, assignee is apparently unknown to the email component, because it causes the error below.  Assignee is not among the fields modified in the clone detail.

Automation

automation 5-5-23.jpg

Automation email detail

email in automation 5-5-23.jpg

Automation email error

automation error 5-5-23.jpg

Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 5, 2023

Use a Log action to print the {{createdIssue.assignee}} value to the Audit log to see what the actual value is. Typically the assignee attribute returns the user's unique account ID, not their email address. To get their associated email address you need to reference another attribute. Refer to this documentation.

Jira Smart Values - Users 

Phil Bustin
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 5, 2023

The only log action I see is "log work", that gets an error:


LOG WORK
Error trying to log work against an issue
You can not edit the issue as it is in a non-editable workflow state., Worklog must not be null.

I got the same empty assignee error using {{createdissue.assignee.displayName}}, that I found in the Jira Smart Values - Users link you provided.

Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 5, 2023

You should have two actions that start with the word "Log" - "Log" and "Log Work"

Screen Shot 2023-05-05 at 2.04.16 PM.png

 

You received the error because the smart value you provided (displayName) is not populated with an email address. For the To field of the Send Email action you need to be providing an email address. Use the emailAddress attribute.

Screen Shot 2023-05-05 at 2.15.50 PM.png

Phil Bustin
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 5, 2023

Not at my best today.  Thanks.

Phil Bustin
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 8, 2023

It's working.  Thank you!

Like Trudy Claspill likes this

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PERMISSIONS LEVEL
Site Admin
TAGS
AUG Leaders

Atlassian Community Events