I am trying to configure an automation for triggering a field value update for a 'Number' type field based on difference between 'Start date' and 'Due date' (both built in date fields) whenever any of these fields is updated/changed. Need is to have the duration (in days) between these two dates filled up in the 'Number' field.
Automation put in place is
I configured a smart value for Edit issue fields in the following manner to achieve what I wanted
When the automation is executed, the automation log shows success. Here's the screenshot
However I am not getting the desired result i.e number of days is not getting populated in the 'Number' field 'Duration'
Hello @Saurabh Chaurasia
I believe that the references you are using for those fields in your automation are not correct. The Automation Rule does not detect that as an error in this case.
{{issue.Due_date}}
You need to use the name of your custom field, or the customfield_##### ID, where you have specified "Due_date". Looking at your screen image the actually field name is "Due date" without the underscore. You can use field names that include spaces in smart values; i.e.
{{issue.Due date.diff....}}
Similarly your reference to the Start date field should not have an underscore in it.
If the visible name doesn't seem to work, this article tells you have to find the smart value for a field.
https://support.atlassian.com/cloud-automation/docs/find-the-smart-value-for-a-field/
Here is a debugging tip for Automation Rules. Use the Log action to print your smart values to the Audit Log to ensure that you are getting the value you expect when you use those smart values. If you have not provided the correct smart value, you won't see the value you expect, which gives you a clue to look at the smart value you used.
Thanks Trudy,
I had tried this before posting the question. It didn't work earlier and even now.
Just to check if it is working with other date fields I tried with 'created' date and it worked actually
Not sure why it is not working with 'Start date'.
Note:- I haven't custom created 'Start date'. Its an built in date field.
Do you see any other root cause?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Try adding a Log action to print the value of the Start date field - {{issue.Start date}}. Confirm that when the rule is using that smart value it is actually get the value you expect.
Note that the Start date field you show in the last screen you posted is not necessarily the same as the Start date field used in a Team Managed. That screen lists custom fields that have been set up for Company Managed. projects. Such fields that have been defined with a Global context may be used in a Team Managed project, or the Team Managed project may have an identically named by local custom field.
The custom fields available in a Team Managed project can be localized to belong to only that project, and as such may have the same name but be referencing a different storage space in the back end. You can confirm this with by checking the ID of the custom field.
From the screen you showed listing Custom Fields you can find the field ID by hovering over one of the Action options and looking at the URL that shows at the bottom of the browser.
For a Team Managed project you can use an API call to show all the fields associated with a specific issue and from that get the custom field ID, as detailed in the page link I provided previously
https://support.atlassian.com/cloud-automation/docs/find-the-smart-value-for-a-field/
To ensure you are getting exactly the field you want in your automation you can use the custom field ID rather than the field name:
{{issue.customfield_10015}}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.