Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Getting the no of businessDays saved to a text field, single line

Tania van Wyk de Vries May 9, 2019

I am trying to extract the number of business days that lapsed since the issue was created till the day a specific field is updated. 

PO Time to Resolution is the text field and the script I am using is:

{
"fields": {
"PO Time to Resolution": "{{now.diff(issue.created).businessDays}}"
}
}

 

I suspect there needs to be a conversion between businessDays and text in order to get it to show in the field as if I use this script:

{
"fields": {
"PO Time to Resolution": "{{now.diff(issue.created).businessDays}}d"
}
}

 

It will write "d" to the field.

 

Any input welcome please

Using this link as reference: https://docs.automationforjira.com/working-with-issue-data/date-functions.html#manipulating-dates

1 answer

1 accepted

0 votes
Answer accepted
Deleted user May 9, 2019

Hi there,

Developer from CodeBarrel here.

{{now.diff(issue.created).businessDays}} (or {{now.diff(issue.created).abs.businessDays}} if you want a positive number) should be output the difference in days. I suggest trying out our edit issue picker with your custom field and the same smart value and seeing if it works in that fashion, JSON can be tricky with getting the names of fields and structure right. If it's still not working then I'd suggest you raise a support ticket with some screenshots of your audit and audit log here: https://automationforjira.com/contact-us/

Screen Shot 2019-05-10 at 1.42.54 pm.png

Cheers,
Yvan

Tania van Wyk de Vries May 9, 2019

Thanks. That is the rule we are using. It is still not working I am afraid. Just added in abs. and no luck.

Deleted user May 9, 2019

If that's the case could you please raise a support ticket here so we can further troubleshot your issue https://automationforjira.com/contact-us/.

Cheers,
Yvan

Tania van Wyk de Vries May 9, 2019

Call logged yes. Thanks for confirming that I am not loosing my mind ;-).

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events