The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

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

Adding a Numerical Custom field to a Due Date using smart values

John Haworth
Contributor
April 14, 2023

Hi

We have a 3rd part provider who provides estimated for work. These estimated exclude business days. We have to update the due date on planned work a lot in jira roadmaps which creates a lot of overhead and admin when the plan changes

The logic I'm trying to create is 

 

Sprint start date + Size + Business days = Sprint Due date

Size is a custom numerical field, {{issue.fields.customfield_11714}} 

 

I've tried the new syntax 

{{Issue.Sprint.startDate.jiraDate.plusBusinessDays(6)}}

This works when there is a static value in ()

 

However I cant get this to work when there is a variable 

{{Issue.Sprint.startDate.jiraDate.plusBusinessDays(issue.fields.customfield_11714)}}

I've also tried the above where customfield_11714 is created as a variable 

I found this article with a work around using an old syntax but the solution no longer appears to work 

{{#issue.field}}func=plusBusinessDays({{yourVariable|numeric field}}){{/}}

 

I'm now down to creating this as the mother of all if statements setting the date using static values based looking up using jira automation 

IF Size =1 {{Issue.Sprint.startDate.jiraDate.plusBusinessDays(1)}}

IF Size =2 {{Issue.Sprint.startDate.jiraDate.plusBusinessDays(2)}} 

etc. But this is obviously ugly as sin. Has anyone got a nicer solution?

 

 

 

1 answer

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

0 votes
Jack Brickey
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 Champions.
April 14, 2023

Hi John, I can't get to where I can test out some automation at the moment. However, I'm wondering if the following might work.

create a variable action component, e.g.

size = {{issue.customfield_11714}}

then use the variable in your smartvalue statement 

{{Issue.Sprint.startDate.jiraDate.plusBusinessDays(issue.fields.size)}}

John Haworth
Contributor
April 17, 2023

Hi Jack 

I'm afraid not, I tried this,(probably wasn't clear enough in my explanation)

I've also tried the above where customfield_11714 is created as a variable 

Where the static version returns a date, this just blanks the value in the field its being returned to 

DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events