Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

How to get automation triggered when SLAs breach time is updated

Jean-Paul Quantin April 18, 2023

Hi there! I create a Jira Service Management automation, so that I have the breach time of one SLA copied into another field of the issue (due date in this case). I use "Field value changed" condition, as illustrated here (name of my SLA is "Time to resolution"), but unfortunately it does not seem to fire, any chance to make that work?

 

Sélection_084.png

NB: I also tried to select this option:

Sélection_085.png

but it does not give any solution.

2 answers

1 vote
Ryan Northfield _Mumo Systems_
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.
April 18, 2023

@Jean-Paul Quantin 

What exactly do you want to trigger off of? Triggering off of an SLA field value change theoretically may only trigger(whenever the SLA has been edited in the project admin settings, or when it breaches (I am not certain, I would need to do more testing to know for sure). 

If you wish to trigger based off of an SLA breach, there is a trigger specifically made for that. 

If you wish to populate the Due Date as soon as possible after the issue is created, then make the trigger based on "Issue Created."

Is there a reason either of these triggers won't work for you? 

(As a side note: you may have already figured this out, but I believe the Action for this would be the "Edit Issue" action that edits the Due Date field with the following smart value: {{issue.Time to Resolution.ongoingCycle.breachTime.jira}})

Jean-Paul Quantin April 19, 2023

Hello! Thank you for your interest into my issue. Let me give more information to explain what I need:

- I have a service level, named "Time to resolution", that has different breach time, depending on another parameter (here, it is the severity of the JSM ticket), here is how it is defined in JSM:

Sélection_086.png

- when I change the severity of the JSM ticket, the SLA breach time gets updated by JSM, in an asynchronous manner (by design of JSM this is obviously asynchronous)

- I would like to have an automation that triggers when the "Time to resolution" breach time changes, so that I can copy it in another filed of the issue (in this case, the due date)

- I tried to use "Field value changed" trigger, and my SLA is proposed in the list (I can see "Time to resolution" proposed). But unfortunately, this trigger does not fire when the "Time to resolution" service level is updated.

- I also tried to use "Field value changed" trigger, directly on the "severity" field, but when I use that, I get the previous value of the "Time to resolution" breach time, because, as it is asynchronous, it is not updated yet.

My issue is similar to another one described here: https://community.atlassian.com/t5/Jira-Service-Management/Time-to-resolution-copy-to-Due-date-minus-one-day/qaq-p/2286780 except that I just want to copy to Due date, without any computation (just take the date).

I hope this is clearer, thanks in advance for your help!

Ryan Northfield _Mumo Systems_
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.
April 21, 2023

@Jean-Paul Quantin Thank you for explaining, this makes a lot of sense now. 

I agree with you that you would think that the field value change trigger based on the SLA would do what you want, but as I test it myself, it doesn't. In fact, I've tried many different scenarios just to see what causes that trigger to trigger, but, I can't figure it out. I wish there was better documentation. 

As I've been thinking about this, I have two suggestions for a workaround:

1) you could set the trigger to "Field Value Changed" based on your severity field, then, instead of trying to copy and paste from your SLA as you mentioned, simply calculating the Due Date separately. You would need an if/else condition block, checking for each of the severity fields that maps to a specific SLA goal, and then setting the Due Date accordingly. 

As you can see in the image (I don't have your Severity custom field, so I used priority), if you use the start time smart value {{issue.Time to Resolution.ongoingCycle.startTime.jira.plusHours(2)}}, you can add the hours (2 for critical, 8 for major, 56 for Medium). The only concern I would have with this is the major and medium goals are based on the business calendar, so you would want to somehow figure that into the calculation. This might be overly complex, so this solution might not be what you want. Smart Values can add based on Business Days (.plusBusinessDays()) but that's days, not hours, and their business day is 9am-6pm, when the sample calendar business day is 9am-5pm. 

Screenshot 2023-04-21 at 10.19.27 AM.png

2) The 3rd party marketplace app Scriptrunner might be able to keep these in sync as you want, but I'm not certain. 

Shahar Nissim March 6, 2024

Hey, 1 is not working as the automation run immediately after the field change and give the old SLA value before the calculation is done

Any solution?

0 votes
Jean-Paul Quantin April 19, 2023

(this was intended to be a reply, not an answer, got misleaded)

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
TAGS
AUG Leaders

Atlassian Community Events