Automation for Jira - Automatically Add Label to Stalled Tickets

Jack Arndt February 9, 2020

Hi Automation Community!

I'm trying to figure out a way to automatically tag tickets that are stalling in our downstream release process.  I need help understanding if this is feasible to solve using Automation for Jira and if yes, a recommended way of proceeding.

 

User Story:

As a Release Manager,

I want Automation for Jira to add a custom label to any Jira issue that has sat in our Jira Workflow Status "Ready for Pre-Prod" for 5 calendar days,

so that I can quantify and measure the impacts of downstream dependencies.

 

Thanks in advance for your support and help!

3 answers

1 accepted

4 votes
Answer accepted
edwin vasquez
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.
February 9, 2020

Hello @Jack Arndt ,

This is possible with Automation for Jira and after some testing I was able to accomplish what you asked for.

What you need to do is create a rule that will run a trigger (I would suggest scheduled everyday, at start of day), search for issues matching your query, and then edit the issue to add the label. This is the rule I created, I set my trigger to Manually triggered so its easier to test.

trigger.pngand this is the JQL I used to find those issues.

project = "Sample Project1" AND status = "In Progress" AND NOT status changed after startOfDay(-5d)

 

As you can see, there is no labels prior to me manually running the rule.

trigger2.pngAfter running the rule...

trigger3.png

I would suggest to also create a rule that will remove the label when the issue is transitioned to any other status. I hope this helps and answers your question. Let me know if you need any clarification.

Jack Arndt February 10, 2020

Thank you!

Alex Bernardin February 21, 2020

edwin - i came on this post when working on a similar problem. But what I found is that the rule as you set it (which is also how I initially solved it) removes existing labels.  Essentially the 'edit field' action seems to replace the field value, which with labels is not always what you want.

If anyone has a way to _add_ a label without affecting existing labels, I'd love to know...

 

Or if other people are not seeing this function have the same effect, that would also be great to know...

Like # people like this
Alex Bernardin February 21, 2020

ah!  I figured it out.

When you use the Edit Field action, there's a text field for entering the new value.  To the right of that field there's an elipsis overflow menu icon.  Clicking that icon gives you options for adding or removing explicit values from the field, instead of just replacing the field.

 

@Jack Arndt you might want to update your automation rule to avoid losing label data

Like # people like this
edwin vasquez
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.
February 21, 2020

Thanks for Sharing @Alex Bernardin 

Julia Anderson August 16, 2022

@Alex Bernardin that setting still didn't work for me and old labels are getting wiped out. Any help is appreciated!

Jeremy Tapsell September 5, 2023

@edwin vasquez - I am wanting to follow your step of automating the daily trigger, but I can't find any way to do this.  Once I have tested my rule with the manual trigger, how do I transition this to a automated daily trigger?

 

Nevermind - I have located the scheduled trigger :) 

0 votes
Arnav April 22, 2022

Auto add label on issue creation.PNGI have created this rule for auto add the label. the rule is working fine
Query-  Could you please give me the idea of giving like this?

{{#issue.labels}}"{{.}},{{/}}" {{issue.labels}}"

0 votes
Johanna Hauxwell
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
May 27, 2021

@edwin vasquez The above info you have shared is really helpful and will hopefully solve a similar problem I am currently working on.  I have one question though, is Automation for Jira a plugin you are using or is it existing functionality in Jira Cloud? If it is a plugin could you please send me the link to it in the marketplace so I can look into this? Thanks!

Suggest an answer

Log in or Sign up to answer