For my current automation I want to make sure that my current issue's second-to-last status was X.
I have found that you can get the last status using the changelog:
{{#changelog.status}}{{fromString}}{{/}}If the changelog is a bunch of text, shouldn't it be possible to get the second-to-last status too with the right syntax? Unfortunately I'm not clear on the syntax.
Thanks for any help.
Given you are on Enterprise, you could get this from Atlassian Analytics.
The jira_issue_history table contains all status changes, and anything with no end date means that this is the current state.
For each state it tracks the previous and current value.
Therefore, you could find the status change with the latest end date, then the previous value field would give you your answer:
Field | Start Date | End Date | Previous Value | New Value
Status | 01/01/2026 | 05/01/2026 | To Do | In Progress
Status | 05/01/2026 | | In Progress | Done
Something along the lines of:
Select jira_issue_history_id
From jira_issue_history
Where 'End Date' Is Not NULL
And Field = 'Status'
And 'End Date' = (
Select Max ('End Date')
From jira_issue_history
Where 'End Date' Is Not NULL
And Field = 'Status')
Just some more stuff around that to give you details, but should get you there.
Outside of this, I can't think of any way to do this through automation. The API may be an option, but not overly convinced it would be any better.
The changelog status is always in the format {{changelog.status.fromString}} to {{changelog.status.toString}}.. Maybe if you can provide more information to allow us to assist you further.
What is your current output from your smartvalue?
Best, Joseph
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Joseph Chung Yin Thanks for your reply.
Let's say the issue in question went through the following status: To do > In Progress > Closed. Currently the issue is in status Closed.
This means
{{#changelog.status}}{{fromString}}{{/}}
evaluates to "In Progress".
{{#changelog.status}}{{toString}}{{/}}
evaluates to "Closed".
I am looking for the expression to get the result "To do" (in the scenario described as an example here).
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.