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 Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
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, atlassian community, loom ai, atlassian loom ai, loom, atlassian ai, record recaps of meetings, meeting recaps, loom recaps, share meeting recaps,

Loom’s guide to great meetings 📹

Join us to learn how your team can stay fully engaged in meetings without worrying about writing everything down. Dive into Loom's newest feature, Loom AI for meetings, which automatically takes notes and tracks action items.

Register today!
AUG Leaders

Atlassian Community Events