Hello!
This is a strange one to word, so apologies if it makes zero sense!
I am working on creating a post-function that sends a comment in a request, but I only want the comment to be posted if no SLA is active (The SLA information is "Due Date" or customfield_13779)
I have tried various iterations of: {{issue.fields.customfield_13779.completedCycles.breachTime == NULL}} and {{issue.fields.customfield_13779.remainingTime == NULL }} and {{issue.fields.customfield_13779.remainingTime.friendly > 1m }}
But had no luck so far as the nunjucks always returns True, regardless of SLA being active or not, so I'm clearly looking at this at the wrong angle. I have taken a dump of the field while the SLA is active vs when it is inactive:
Active SLA
"id": "243",
"name": "Due Date",
"_links": {
"self": "https://jirajirajirajira.atlassian.net/rest/servicedeskapi/request/415715/sla/243"
},
"completedCycles": [],
"ongoingCycle": {
"startTime": {
"iso8601": "2024-02-19T15:35:29+0000",
"jira": "2024-02-19T15:35:29.174+0000",
"friendly": "Yesterday 3:35 PM",
"epochMillis": 1708356929174
},
"breachTime": {
"iso8601": "2024-03-04T15:35:29+0000",
"jira": "2024-03-04T15:35:29.174+0000",
"friendly": "04/Mar/24 3:35 PM",
"epochMillis": 1709566529174
},
"breached": false,
"paused": false,
"withinCalendarHours": true,
"goalDuration": {
"millis": 288000000,
"friendly": "80h"
},
"elapsedTime": {
"millis": 8508034,
"friendly": "2h 21m"
},
"remainingTime": {
"millis": 279491966,
"friendly": "77h 38m"
Inactive SLA
"id": "243",
"name": "Due Date",
"_links": {
"self": "https://ocadosupport-sandbox-587.atlassian.net/rest/servicedeskapi/request/415716/sla/243"
},
"completedCycles": []
Any help would be greatly appreciated!
Kind Regards,
Ste
Hi @Stephen Dyball ,
Please add a conditional execution as below:
{{issue.fields.customfield_13779.ongoingCycle != null}}
To check if the SLA is active.
Hope this helps!
Thanks,
Reshma
Thank you for this - worked a treat! I just had to change this over to "== null" for my use case - you've saved me a headache! :)
Thanks again!
Ste
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.