How can I use the Automation plugin to automatically set the Due Date of a new issue being created

I have created a new Rule that creates a new Request upon completion of the previous task (i.e. if status changed to "Done" create new task).

 

However I need to also automatically assign the due date (we have created a custom field 'Due By' which features date and time) for the following month due on the 21st.

 

I thought this would work:

{{#now}}func=withDayOfMonth(21).plusMonths(1){{/}} 

 

1 answer

1 accepted

1 vote

Hi Zach,

I've just tried {{#now}}func=withDayOfMonth(21).plusMonths(1){{/}} and it works just fine.

Perhpaps you are not entering it in the correct field? You need to use advanced entry of the 'Edit Issue' action:

{
"fields": {
"name of your field": "{{#now}}func=withDayOfMonth(21).plusMonths(1){{/}}"
}
}

Thank you, I don't want to mess anything up, currently there is:

 

 "fields": {
"resolution": {
"name": "Fixed"
}
}
}

 

Where should I add this new code?

Nevermind, I just replaced all of the code with your code and updated my field name.

 

Well, there are now no more syntax errors but the new date didn't populate the field. Do you think it's because I failed to include a time?

Ivan Tovbin Community Champion Dec 11, 2017

Can you show me the code you have in advanced options of the rule action? And no, time has nothing to do with it. Even if your field is a date-time type field and you don't specify the time, it will simply set the current time.

Awesome! Your solution worked however I had mistakenly not included the field I was automating to the Request Type, -bonehead move. Since adding this field to the corresponding Request Type, all works like a charm.

 

Thank you Ivan!

Ivan Tovbin Community Champion Dec 11, 2017

Glad I could help.

Cheers!

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Bridget Sauer
Published Thursday in Marketplace Apps

Calling all developers––You're invited to Atlas Camp 2018

 Atlas Camp   is our developer event which will take place in Barcelona, Spain  from the 6th -7th of   September . This is a great opportunity to meet other developers and get n...

362 views 0 6
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you