Forums

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

Post Function to set due date from another filed plus 3 days

Jeff Meyer August 6, 2024

I have a project that auto creates additional tickets in other projects when a ticket is opened in project 1 (using post function "Create new issue"). I have been asked to set the "Due Date" field (in project 2) from the "Target End Date" field (in project 1) and add 72 hours or 3 days to it. I have been able to set the "Due Date" field (in project 2) to the "Target End Date" (from project 1), but not sure how to add the additional time  (72hrs or 3 days) to the "Due Date" field in project 2.

 

Thanks

Jeff

3 answers

1 accepted

0 votes
Answer accepted
Ramin Shanehsaz _Computerra_
Atlassian Partner
August 6, 2024

Hi Jeff,

your post-function "Create new issue" has to come from an app that is installed in your Jira, since it is no standard Jira post-function. Can you tell us which one you are using, so we can help you with your problem?

Best,
Ramin

Jeff Meyer August 8, 2024

It looks to be from Jira Misc Workflow Extensions (JMWE)

 

JMWE.JPG

Ramin Shanehsaz _Computerra_
Atlassian Partner
August 8, 2024

Then, you can use the "Set new fields" functionality in the post-function to set the due date plus three days using the following Nunjucks expression:

{{ issue.fields["Target end"] | date('add' , 3 , 'days') | date("YYYY-MM-DD") }}

So it looks like this in your "Create issue(s)" post-function:

image.png

Let me know, if this works for you :)

Jeff Meyer August 9, 2024

Hi Ramin,

Thank you very much, that worked for what I was looking to do. 

Thanks for taking the time to help me out with this.

 

Jeff

Like • Ramin Shanehsaz _Computerra_ likes this
0 votes
John Funk
Community Champion
August 6, 2024

Hi Jeff - Welcome to the Atlassian Community!

Have you thought about using an automation rule instead of a post function in the workflow? Then it can be used more universally. 

0 votes
Jim Knepley - ReleaseTEAM
Atlassian Partner
August 6, 2024

I think you're looking for the "Date plus unit" function.

...and not for nothing, you might add "BusinessDays" instead of just "days."  :-)

 

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
FREE
PERMISSIONS LEVEL
Product Admin
TAGS
atlassian, team '25 europe, atlassian event, barcelona 2025, jira, confluence, atlassian intelligence, rovo, ai-powered collaboration, developer tools, agile teams, digital transformation, teamwork solutions, atlassian conference, product announcements

🌆 Team '25 Europe registration is now open!

Join the largest European gathering of the Atlassian Community and reimagine what’s possible when great teams and transformative technology come together. Plus, grab your Super Fan ticket now and save over €1,000 on your pass before prices rise on 3 June.

Register now
AUG Leaders

Atlassian Community Events