Hello, Atlassian Community.
I am using JMWE to create a templated release task set.
I want to have the user specify the 'duedate' for a release, and then have all of the corresponding sub-tasks automatically created with their appropriate due dates based on the original due date selected.
I've simplified it below, but I am running into issues trying to calculate a changed due date, I know my script is way off, but I'm looking for a step in the right direction as I came up dry trying to find similar scenarios online.
Hi @Dillon ,
if I understand correctly, each sub-task will have a due date that is calculated relative to the due date of the main issue.
One way of achieving this is to calculate the sub-task due date based on an "offset" you'll specify in the iterator. For example, the iterator could be:
[
{summary:"summary", duedateOffset: -14}
]
and the value for the Due date field will be:
{{ issue.fields.duedate | date('add', it.duedateOffset , "d") | date("yyyy-MM-DD") }}
Hi, @David Fischer - Thank you very much for taking the time to reply and offer a solution. This sounds like it will work exactly as I require, I'm just having difficulties getting the formatting down pat. Excuse my lack of knowledge.
Copy/Pasting your examples above result in (X) on the Groovy Script editor, I tweaked it a bit to get past that - based off of formatting in: https://innovalog.atlassian.net/wiki/spaces/JMWE/pages/1223884853/Advanced+configuration+and+usage+of+the+Create+issue+post-function#Build-an-iterator-to-create-multiple-issues-and-set-fields-of-the-newly-created-issues
I know it must have something to do with the 'duedate' field, but I can't quite pinpoint what, heres how it looks currently for me.
Upon trying to get the post function to trigger, I get the error message below.
We can't create this issue for you right now, it could be due to unsupported content you've entered into one or more of the issue fields.
I am using Jira Server 8.20.1 and JMWE 7.3.0
Thank you again!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Dillon ,
my bad, for some unfathomable reason I provided the answer for Jira Cloud.
For Jira Server/DC, the iterator will be:
[
[summary:"summary", duedateOffset: -14]
]
and the value for the Due date field will be:
issue.get("duedate") + it.duedateOffset
Sorry about that,
David
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you very much, @David Fischer - That worked perfectly!
The duedate field looks much more sensible now, thank you for clearing that up - we appreciate the help here greatly, this will work in a number of situations for us.
Best regards,
Dillon
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.