Dynamic SLAs - possible with ScriptRunner?

Mark Wheeler March 30, 2020

Hi all

I use Jira Service Desk Cloud to commission and deliver software.  We shifted from Software to Service Desk to get the SLA functionality which is serving most of our needs.  However, we have a couple of deliverables which are not based on fixed time periods but instead a date in a custom field.

Has anyone implemented a solution to get SLAs running off custom date fields on an issue?

I've seen some posts about dynamic SLAs and references to the plugin "Extension for Jira Sevice Desk" and looked at the documentation but couldn't see information on how to get dynamic SLAs in place. I've mailed the vendors and wait to see what they say.

https://community.atlassian.com/t5/Jira-Service-Desk-questions/Dynamic-SLA-Goal-in-JSD/qaq-p/124216

https://community.atlassian.com/t5/Jira-questions/SLA-to-be-dynamically-populated-from-a-custom-date-field/qaq-p/397917

Another more recent post said it couldn't been done in the Cloud but there was a roadmap item for it, which I've voted for.

https://community.atlassian.com/t5/Jira-Service-Desk-questions/Dynamically-set-SLA-goal-based-on-due-date-set/qaq-p/1118453

https://jira.atlassian.com/browse/JSDCLOUD-81?_ga=2.248201031.1531792312.1585552370-1618578207.1563807000

So my question to the community is ... I have ScriptRunner and a chap in the team who's very adept with Groovy. Is there a way of creating SLAs via ScriptRunner, which are based on a custom date field?  That is the SLA is created on hitting a particular status and the time remaining on the SLA is based on the custom date field less the current date/time (using a calendar for working hours)?  If so then pointers to the data structure to update and any hints for the approach to the scripting would be greatly appreciated.

Many thanks

Mark

1 answer

1 accepted

1 vote
Answer accepted
Kristian Walker _Adaptavist_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 30, 2020

Hi Mark,

Thank you for your question.

I can confirm that it is not possibly to dynamically set the SLA's provided by Jira Service Desk based on the value of a date field with ScriptRunner for Jira Cloud.

The reason for this is that Atlassian do not provide a Rest API to achieve this functionality inside of the Jira Service Desk rest API documentation located here and ScriptRunner for Jira Cloud is only permitted to use the public rest API's which Atlassian provide and mark as being able to be used by apps.

However a workaround you could use would to be have a custom field such as a text field where you store your SLA in and then you could write a Script Listener which ran on the Issue Updated event and got the values from the date fields and then performed some logic to calculate the value and set this to the custom field on the issue.

I can confirm we have some examples of getting and setting field values in the documentation pages here and here which will be a useful reference if you wanted to create a script to do this.

I hope this information helps.

Regards,

Kristian

Suggest an answer

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

Atlassian Community Events