Forums

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

JMWE Change due date for all linked issues

Chris Thomas
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 27, 2023

Requirement:

We have a project that has multiple levels of links called "Blocks"/"Blocked by".  The users would like to change a due date or start date and have it cascade down the line updating the date fields.

For example, is issue #3 has the due date changed from 03/30/2023 to 03/31/2023, then the linked "Blocks" issues will all have their due date/start date increased by 1 day. Then any "blocks" issues they have will do the same.

 

Plan:

I figured doing a issue_field_updated event would be best. The postscript could be "Set issue fields" and point to the blocks linked issues. However other options will work.

 

Where I am:

I put together a line of code that mostly works, but I need to access the "Blocked by" or triggered issue fields. I have tried a few things but I'm not able to get it to access the triggered issue fields.

 

{{issue.fields.duedate | dateadd( issue.fields.duedate | date('diff',issue | fieldHistory( "Due date") | last | field("from_string"),'days'),"d")}}

The above line works, however putting it in live would probably cause a loop.

It does the following:

1. Gets the previous "Due date" value

2. Finds the difference between the old due date and the current due date

3. Out puts the modified due date.

 

The problem of course is it's reading from the same ticket, where it needs to get #1 and #2 from the triggered issue, not it's self.

Any help please?

 

P.S. This document needs to be updated, I spent over an hour trying to figure out what was wrong with my code before I found out I needed to use dateadd(X,'days').

0 answers

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events