Hi Community,
We are trying to build a Jira Cloud Automation rule in our project that will extract information about the last change on the issue:
Last updated date/time
Which field(s) were updated
Old → new values
{{changelog}} smart values directlyI’ve tried multiple variants inside Log action steps, such as:
{{changelog.histories}} {{changelog.histories.last.created}} {{changelog.histories.last.items.last.field}} {{changelog.histories.last.items.last.fromString}} {{changelog.histories.last.items.last.toString}}I tested with different triggers:
Manual trigger from work item
Issue commented
Issue updated
In all of these cases, the log output for {{changelog…}} is empty (nothing prints in the rule audit log).
From the documentation, I understand that {{changelog}} is only populated for certain triggers/events, but even with Issue commented/updated I’m not seeing anything on this site.
Hello @Surya Paandeeswaran SUNDARAGANAPATHI
Welcome to the Atlassian community.
As per the documentation the smart value {{changelog}} is available only when the trigger for the rule indicates an event that edits the issue has occurred, such as Field Value Changed
https://support.atlassian.com/cloud-automation/docs/jira-smart-values-issues/#--changelog--
Given that the trigger you used was Manual, there is no change log for the rule to access.
The smart value is not used to access the entire history of changes for an issue. It accesses only the changes from the event that triggered the rule.
Actually I may be incorrect.
But I don't believe "histories" is a valid attribute for changelog. Where did you get information about that attribute?
You mentioned the Issue Commented event. What exactly are you try to do with this rule?
If you are explain what you are trying to do we may be able to give you more relevant guidance.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello @Surya Paandeeswaran SUNDARAGANAPATHI
welcome to the community!
To add to what @Trudy Claspill mentioned {{changelog.histories}} isn't a valid attribute, which is likely why you're seeing empty results. The changelog smart value only supports field-specific properties like {{changelog.status}}, {{changelog.summary}}, {{changelog.issuetype}} etc.
For what you're actually trying to do (field name + old → new values), {{fieldChange}} is the right smart value:
{{fieldChange.fromString}} — previous value
{{fieldChange.toString}} — new value
This needs to be used with a Field Value Changed trigger, which gives you both the changed field and its values in context. The Manual trigger and Issue commented trigger won't populate these.
So if you want to capture the last changed field and its old/new values, set your trigger to Field Value Changed, leave the field unspecified (to catch any change), and use {{fieldChange.fromString}} / {{fieldChange.toString}} in your log action.
Have a great Start in Week :)
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.