Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Update due date of blocked issues if due date changes

MiDa I'm New Here Jan 11, 2022

Hello!

I do have many issues which block other issues. 

If I change the duedate of an issue, I want the start date and due date of every blocked issue to be changed by the same delta.

 

Example:

Issue1: due date = 10.1.2022 blocks Issue2 (link is set)

Issue2: starte date = 20.1.2022; due date = 14.2.2022

 

Now if Issue1 due date is changed to 15.1.2022 (delta = 5 days) I want Issue2 start date and due date to change by 5 days too.

 

My rule looks as follows:

image.png

with:

{{issue.duedate.plusDays(fieldChange.to.diff(fieldChange.from).days)}} 

and 

{{issue.startdate.plusDays(fieldChange.to.diff(fieldChange.from).days)}}

 

Due date and start date, both endup empty.

 

What is wrong with the calculation?

 

Thanks for your help!

 

1 answer

1 accepted

1 vote
Answer accepted

Hi @Michael Dammerer -- Welcome to the Atlassian Community!

First thing: please think about your edge cases to test and decide how to handle them in the rule:

  1. empty Due Date to empty value (this is possible for some edits)
  2. empty Due Date to non-empty value
  3. non-empty Due Date to empty value
  4. normal case: non-empty Due Date to non-empty value

Next, I wonder if there is a field typing issues, so perhaps try adding toDate before the diff() calls, such as

{{fieldChange.from.toDate}}

If that doesn't work, try explicitly referencing the changed field data with:

{{changelog.due date.from.toDate}}

Kind regards,
Bill

MiDa I'm New Here Jan 12, 2022

Thanks for your Help. Now it Works.

I had to fix two bugs:

I needed to add toDate as you proposed. 

and "issue.startDate" needs to be "issue.start Date" with a space.

 

which is weard, because "issue.dueDate" is without space.

 

My Automation now looks like this:

image.png

 

with the formulas:

for duedate:

{{issue.duedate.plusDays (fieldChange.from.toDate.diff(fieldChange.to.toDate).days)}}

 

for start date:

{{issue.start Date.plusDays(fieldChange.from.toDate.diff(fieldChange.to.toDate).days)}}

Well done; I am glad to learn you got this to work!

The smart values are case-sensitive and spacing-sensitive, so when in doubt use the information in this how-to article to confirm the smart values: https://support.atlassian.com/cloud-automation/docs/find-the-smart-value-for-a-field/

Also, I note in your rule that you are editing the same issues within the branch multiple times.  That could cause some problems of data getting "walked over" by later edits.  I recommend changing your branch to:

  • branch: on linked issues
    • action: edit the description
    • action: re-fetch  (This will reload the issue data before proceeding, although it will slow down the rule a bit.)
    • condition: due date is not empty
    • condition: start date is not empty
    • action: edit the due date and start date fields with one action (You may select multiple fields for an edit operation)
  • ...

Please let your testing decide if you want to do this change.  If your rule works and the description is still present after the date field edits, your rule is okay as-is.

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Apps & Integrations

Send an Email or Publish to Confluence - What should you do with your release notes?

Background When you hear the words ‘Release notes’, almost always you think of an unsolicited email from a software vendor. But I am here to tell you that from our data, sending release notes via E...

102 views 1 2
Read article

Community Events

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

Find an event

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

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you