Change a Date using a custom field Number

Maela Aseglio April 25, 2024

I am trying to change the End Date using an automation starting from an existing field (set as Number instead of day).

I read that you should set the Number in Days in order to be calculated but it does not work.

i did 1 automation which are applied in 2 different transition in the workflow. 

In the first automation which is working, I extracted the Number of days (Duration) ==>customfield in Number)

between the planned and the start date.

Now,

I want , with the 2nd automation, add this number to the end date starting from the previous value already set Planned END date. 

 

The automation should be as follow : 

When Value changes for StartDate 

then 

Edit Issues field : End Date as follows 

{{issue.Planned END Date.plusDays(issue.Duration.asDays)}}

 

 

2 answers

2 accepted

1 vote
Answer accepted
Dexter de Vera
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 25, 2024

Hi @Maela Aseglio ,

If Planned END Date is a date or datetime field nd Duration is a number field. Use below smartvalue.

{{issue.Planned END Date.plusDays(issue.Duration)}}

Maela Aseglio April 25, 2024

Thanks a lot but it does not work. the automation is as follows : 

When : Value Changes for Start Date, Edit 

End date and set the value as follows :

{{issue.Planned END Date.plusDays(issue.Duration)}}

is it possible that the mistake comes from the that end date is without value at the beginning?

Maela Aseglio April 25, 2024

I tried with another field to understand the issue ( a field with a date) and it happens that when i run the automation, the date which was previously set, disappears , how is it possible?

Dexter de Vera
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 25, 2024

Can you show us your 2 automation and the intial value of the dates.

Maela Aseglio April 25, 2024

1st transition from Analysis to Planning, I put the PLanned Start Date & Planned End Date . 

in the second transiiton that you see below , from Planning to In rpogress, i check between Planned Start Date and Start Date the delta days and the automation fills a custom field called Duration. It works. It provides me the Delta days between the 2 fields

1st automation 2024-04-25 14_43_21-Window.png

smart value used : 

{{issues.Planned Start Date.diff(issue.Start Date).days}}

The custom field duration comes out with a Number . 

Duration Number 2024-04-25 14_51_44-Window.png

 

Second Request. 

when i transition from planning to in Progress, in the screen I add the Start Date and i am asking to the automation to use the Duration field value (2 in this example) to be added to the initial plannned END Date . 

2nd 2024-04-25 14_43_45-Window.pngsmart value used as mentioned by you  does not work so i tried this one below :

{{issue.Planned END Date.plusDays(issue.Duration)}}

 

In this case, the value PLANNED END DATE disappeared completely

Maela Aseglio April 25, 2024

I provide you more details in the hitory here below :

history 2024-04-25 15_01_28-Window.png

Dexter de Vera
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 25, 2024

Update your trigger and use the Duration, so it will trigger when the Duration is already have a value. There is a chance that the 2automation is triggered at the same time where Duration dont have yet value. 

Also Im confuse about the End date. base on the instruction earlier:

Edit Issues field : End Date as follows 

{{issue.Planned END Date.plusDays(issue.Duration.asDays)}}

 

So you said edit Issue field is End Date not the Planned END Date. but base on your screenshot, you are updating the Planned END Date. 

But nevermind, you just need to update the trigger Issue. then make sure that the automation is checked to allow other rule to trigger the automation

image.png

Maela Aseglio April 25, 2024

I changed as mentioned by you, triggering the action when the Duration field has a value and by changing the planned END date with END Date but it does not work .

Dexter de Vera
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 25, 2024
  • Can you show the audit log of the automation.
  • Did you use this - {{issue.Planned END Date.plusDays(issue.Duration)}}
Maela Aseglio April 26, 2024

I found the mistake, it was as you mentioned that the field has been updated too early and it does not see a value . For that reason, i am going to see if i can schedule a daily automation or otheriwise how can i do it

Dexter de Vera
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 26, 2024

Like I said. use the trigger issue field Duration. If you can show us the auditlog maybe we can help you better.

Maela Aseglio April 26, 2024

Automation 2024-04-26 12_37_41-Audit log - Automation - TEST BOX - Jira.pngAudit log 2024-04-26 12_37_13-Audit log - Automation - TEST BOX - Jira.png

Dexter de Vera
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 26, 2024

Have you checked the automation is checked to allow other rule to trigger the automation. I cant see if the automation us successfully run or not.

Maela Aseglio April 26, 2024

what does it mean the automation is checked ? the automation is enabled ...is active 

Dexter de Vera
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 26, 2024

The screenshot i shared. There is a checkbox at the button of automation rule details. Where you need to checked so it allow other automation to trigger your 2nd automation.

Maela Aseglio April 26, 2024

thanks a lot, it works, you are a magician :)

0 votes
Answer accepted
Bill Sheboy
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.
April 25, 2024

Hi @Maela Aseglio 

You may have the incorrect smart value for the field in your expression.

Smart values are name, spacing, and case-sensitive, and sometimes the smart value does not match the exact displayed field name on the Jira pages.  When an incorrect smart value is used, it is replaced with null, often causing no errors in rules.

To find the correct smart values for your field, identify an issue with your field filled-in, and then use this how-to article to confirm the smart value, or custom field id, to use:

https://support.atlassian.com/cloud-automation/docs/find-the-smart-value-for-a-field/

Kind regards,
Bill

Maela Aseglio April 26, 2024

I have updated and triggered the action based on Duration and not on start date but it is not working . the audit log mentions only Cong change without any action . If i use as trigger start date, it gives me success without adding any value in the plannned end date . I suppose that the duration which is expressed in number is not changing in days and for that reason it is not recognizing the field type

Maela Aseglio April 26, 2024

I found the mistake, it was as you mentioned that the field has been updated too early and it does not see a value . For that reason, i am going to see if i can schedule a daily automation or otheriwise how can i do it?

thanks

Bill Sheboy
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.
April 26, 2024

I am getting a bit lost on the changes you are making which are helping / not helping.  My recommendation would be to:

  • post an image of your entire rule in one image, providing overall context
  • post an image of any specific actions
  • post an image of the audit log details showing the rule execution
  • restate the scenario you are trying to solve, perhaps in GIVEN WHEN THEN format for clarity

 

For an example scenario:

GIVEN field-X has a value

WHEN field-Y is changed

THEN set field-Z to "now" plus the difference between field-X and field-Y

 

Suggest an answer

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

Atlassian Community Events