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

Using smart values a paratemers in plusBusinessHours()

Juan Caracoche May 16, 2024

to avoid creating lot of if then rules, I created a lookup variable to set the SLA in hours based on issue's priority.

I'm able to get the value for a given issue's priority but when trying to use that output to add those hours to the {{issue.created}} to set the Due Date, I'm not getting anything.

{{issue.created.plusBusinessHours(daysRndSLA.get(issue.priority.name.toLowerCase()))}}

Log show me that {{daysRndSLA.get(issue.priority.name.toLowerCase()}} is returning the value

On the other hand, this works

{{issue.created.plusBusinessHours(16))}}

 

I tried combinations of creating an intermediate variable, the variable's log look ok but combining with the plusBusinessHours() it doesn't work.

 

I want to avoid doing 5 if then rules.

 

Thank you in advanced

 

PS: I'm using Jira Cloud

 

1 answer

1 accepted

0 votes
Answer accepted
Kalyan Sattaluri
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.
May 16, 2024

Hello @Juan Caracoche 

if {{daysRndSLA.get(issue.priority.name.toLowerCase()}} is giving a value, then try to convert it to number, like below and try:

{{issue.created.plusBusinessHours(daysRndSLA.get(issue.priority.name.toLowerCase()).asNumber)}}

Hope it helps.

Juan Caracoche May 16, 2024

Thank you!!! It works!

I have tried with ".number" I did not try "asNumber"

 

Thank you you save me doing a mess with multiple ifs!

Like Kalyan Sattaluri likes this

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events