Forums

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

Due date automatic add

Tim Shirazi July 3, 2023

Hi I'm looking to add due date according to Category label fill.

 

For example - category A = 5 days from the current date in the due date.

This is the script that the Chat provide me but its not working.

Jira..png

2 answers

4 votes
John Funk
Community Champion
July 3, 2023

Hey Tim,

That looks horrible. I would suggest not using Chat for that. 

So in the Due Date field use this: {{issue.duedate.plusBusinessDays(5)}}

Evgenii
Community Champion
July 3, 2023

Hi, @Tim Shirazi 

Agree with @John Funk , it's better to use standard Smart Values. 

Code, which you wrote - it's groovy code, used in ScriptRunner. Of course, you can use it for setting duedate, but it's must be made in special Action (and again, using Smart Value is more optimal in your case)

image.png

0 votes
Tim Shirazi July 3, 2023

@John Funk thank you for the fast reply! 

I tried your advice for  {{issue.duedate.plusBusinessDays(5)}}.

its run successfully at the Audit log but unfortunately the due date still empty.

 

Can you  please assist?  1.png2.png3.png

John Funk
Community Champion
July 3, 2023

Was the Due Date empty before it ran? 

Tim Shirazi July 3, 2023

Yes it was @John Funk .

John Funk
Community Champion
July 3, 2023

Sorry, I missed that it was the current date. Use {{now.plusBusinessDays(5)}}.

Tim Shirazi July 3, 2023

Great !!@John Funk 

Thank you.

general question, it has to be business days? our company is working 24\7. 

Like John Funk likes this
John Funk
Community Champion
July 3, 2023

Great! Glad it is working!

No, you can use  {{now.plusDays(5)}}

Like Bill Sheboy likes this

Suggest an answer

Log in or Sign up to answer