I'm trying to automatically set an issue's due date based on the following:
1. If the value of custom field "Departure Date" is more than 3 days away, then set the due date to now.plusDays(3) - since it can wait a little.
2. If the Departure Date is within 3 days from now, make the due date right now (because we gotta do stuff immediately).
I have scriptrunner but I'm new with it, so I'm trying to use Automation. I have an If statement checking JQL and that part seems to work, but its erroring out saying the Due date field may be unavailable for the project/type. I've checked in screens and in my field configuration and Due date is definitely in both, so not sure what to try now.
I've tried setting Due date as {{now}}, {{now.plusDays(3).abs}}, {{now.plusDays(3).format("MM/dd/yyyy")}} etc with no luck.
Figured out I had shot myself in the foot and accidentally blocked Automation for Jira's edit rights, so it just couldn't write the field. Once I re-added permissions for Automation for Jira then everything worked. Whoopsies.
Hi @Mike Prill , thanks for your question.
First, I always recommend that people take a look at the Automation library provided by Atlassian here -Jira automation template library | Atlassian. This is a great place to see some worked examples of what is possible.
If you search the word 'date'. you can see there are some rules here which might give you some ideas -
I have some questions for you now. This issue, FLRT-24, for which criteria should it be triggering the automation? The feedback that the automation has given is that the issue doesn't match the JQL. Have you tried just pasting the query into the filter results to see how many issues meet the criteria?
Next, I would advise to break that JQL query down and run more tests to see up until what point the rule still runs without an error. You can also try putting a log action into the rule to return the results, for example, of the 'Departure Date' so you can see against which criteria the action should be called.
I hope this gives you some ideas of what to try next. If you need more help, please write us here.
Cheers
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The jql does show me the correct items when I use it as a filter. I've tried simple and complex jql but the error still surrounds the due date field.
Here's an example of much easier jql but the same due date field issue:
I'm just using " {{now.plusDays(4)}} " as the action, which I see in several examples.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.