Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Automation that sends warning only in case of unlinked item

Ana Luiza Chagas
Contributor
September 6, 2023

Hey guys!

I'm doing an automation in jira that sends emails if my project's stories don't have linked items. But I noticed that even when there are linked items in stories, I get warning emails.

I'd like to create a rule that sends a warning e-mail only in cases of missing linked items, and otherwise takes no action!!

Has anyone seen something similar? I will attach how my rule is currently.

Thanks!

ex..PNG

1 answer

1 accepted

1 vote
Answer accepted
Wouter van den Berg
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
September 7, 2023

Hi @Ana Luiza Chagas

Looking at your use-case and and trying to grasp where you are getting with limitation on JQL in terms of linked issue searching without the help of Scriptrunner et cetera. I came up with this one. 

Screenshot 2023-09-07 at 18.47.27.png
This rule is triggered when a new Sprint is started. It will branch off on Issues in Sprint. When you select the Create a branch, select Branch rule / related issues and select Issues in the sprint. This will go over each item that is in that started sprint. In the next step I added the Related Issues condition with these values: 

Screenshot 2023-09-07 at 18.52.04.png

Then as final step for now I added a log action with {{issue.key}} has no linked issue. So when this rule is completed you can open the Audit log and see all issue keys that have no linked issue. You can chose your own action by sending an email for example and using {{issue.key}} has no linked issue in the message to send out notifications. Or notify the reporter through a comment that it has not been linked. 

Hope this helps. Let me know if this helped in your use-case. If this helped please Accept the answer in this response. 

Ana Luiza Chagas
Contributor
September 13, 2023

Hi @Wouter van den Berg

I followed the flow you suggested and it seemed simpler, but I have a question.
I added the phrase "{{issue.key}}" in the body of the email and received the items in separate email notices in my inbox. Would it be possible to unify all these items into a single warning, and when there are no items the rule takes no action and I don't receive warnings?

Thanks for the help!!

Wouter van den Berg
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
September 14, 2023

No worries. In that case it might be easier to do this: 

Do a lookup issues with: project = "XXX" and sprint in openSprints() and issueLinkType is Empty

Screenshot 2023-09-14 at 11.03.18.png



Then have an email action with this: 


{{#lookupIssues}}
<a>{{key}}</a>
{{/}}

Screenshot 2023-09-14 at 11.04.36.png

This should do the trick. You can format it with links by changing the <a>{{key}}</a> to: 

<a href="{{url}}" target="_blank">{{key}}</a>

This way the key's are clickable in your email. 

 Hope this helps. If this helped please Accept the answer in this response. 

Like Ana Luiza Chagas likes this
Ana Luiza Chagas
Contributor
September 14, 2023

Hello @Wouter van den Berg 

Thanks for the answer!

The clickable keys solution was great and worked great!

But I'm still receiving empty emails like this when all the items in my sprint already have links, I'm studying a solution that doesn't send emails in these cases. Have you ever seen something similar?

Thanks for the help!

e-mail example.PNG

Wouter van den Berg
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
September 14, 2023 edited

Then you need to add an Advanced Compare with {{lookupIssues}} does not equal empty in between the lookupIssues and the email: 

 

Screenshot 2023-09-14 at 16.27.30.png

 

If no issues are found (all issues are linked) the result will be no email. The log will show this: 

Screenshot 2023-09-14 at 16.29.50.png

Ana Luiza Chagas
Contributor
September 15, 2023

This worked perfectly for my project!

Thank you for your help @Wouter van den Berg !

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
PERMISSIONS LEVEL
Product Admin
TAGS
atlassian, atlassian government cloud, fedramp, webinar, register for webinar, atlassian cloud webinar, fedramp moderate offering, work faster with cloud

Unlocking the future with Atlassian Government Cloud ☁️

Atlassian Government Cloud has achieved FedRAMP Authorization at the Moderate level! Join our webinar to learn how you can accelerate mission success and move work forward faster in cloud, all while ensuring your critical data is secure.

Register Now
AUG Leaders

Atlassian Community Events