Smart value for Start date

Matthew May 21, 2024

Can't seem to get the smart value for start date to show a value. I've tried combinations of smart values for {{Start date}}.... issue.startdate, issue.Start date, issue.Start Date,....

When I look at change log, I can get the value using fieldChange.to

ChangeItemBean{fieldId='com.atlassian.jira.plugin.system.customfieldtypes:datepicker', field='Start date', fieldType='null', from='2024-05-29', fromString='29/May/24', to='2024-06-06', toString='6/Jun/24'}

2 answers

0 votes
Matthew May 23, 2024

Hi @Trudy Claspill , The root of what I am trying to do is calculate the delta, but that math doesn't work out and the the datedif function doesn't seem to work with the fieldChange values. I tried the basic math, but it spits out -53 when the dates are just 1 apart.

  I suspect from your original reply there might be a team project that someone created the field with the same name. When I go to the admin>custom fields Start date is locked as a system field. I would imagine system fields would have it's own unique identifier like a customField_1234, but I haven't found anything on it.

 

Interesting that only 1 "-" shows up in the first log action, it should be 2

 

Screenshot 2024-05-23 163105.png

Screenshot 2024-05-23 163201.png

0 votes
Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 21, 2024

Hello @Matthew 

When asking for help with an Automation rule (which I assume you are doing) it will help us to help you if you provide images showing your complete Automation rule and the details of the step where you are having difficulty. Sometimes the issue is the context of the step, or a syntax error, but we can't determine that without seeing the actual rule.

It is also possible that there is more than one field with the same name, and the rule may be having trouble figuring out which of those fields named "Start date" you are trying to reference. In that case you have to find the custom field ID association with the field and reference it by ID rather than name.

Matthew May 22, 2024

Sorry, I didn't know there was other places smart values could be used.

The flow:

when field value changes for "Start date",

  • log action 1: {{fieldChange}}
  • Log Action 2: {{Start date}}

 

I can't reference Start date by Id, as indicated from the change log there is no Id associated with the system field.  Is there no absolute reference to a system field?

Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 22, 2024

Hello @Matthew 

Did you review the information available in the Trigger when you created it? 

Screenshot 2024-05-22 at 6.10.42 PM.png

 

If you want to reference the original value you would use {{fieldChange.fromString}}. If you wanted to reference the new value you can use either {{fieldChange.toString}} or you can reference the field directly from the trigger issue with {{issue.Start date}}

Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 23, 2024

Your syntax is wrong in the first Log Action. You're missing the second curly brace at the end of the first smart value.

Screenshot 2024-05-23 at 9.37.42 PM.png

 

The native "Start date" field actual does have a custom field id. Try following the instructions on this page for printing out all the fields of an individual issue for one of your issues where you have a value set in the field.

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

I think if you look through the list of field names that prints at the beginning of the output you'll find a 'customfield_#####' identifier associated with "Start date".

   "customfield_10132": "Time to done",
    "customfield_10014": "Epic Link",
    "customfield_10015": "Start date",
    "timetracking": "Time tracking",
    "customfield_10005": "Change type",
    "customfield_10006": "Change risk",

 

Regarding your statement that the "datedif" function didn't work, can you show us the actual statement that you used? I recommend you try this:

{{fieldChange.toString.jiraDate.diff(fieldChange.fromString.jiraDate).days}}

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