Workflow: Getting an old value in custom action rule


I am struggling with getting old value of any custom field in my custom action script in YouTrack Workflow. I've created a new action and that's he case i want to achieve:

1. I am changing, for example, 'State' custom field in a issue: 'Open' -> 'In progress'.

2. I am using my new 'Send comment' action:

  1. Action is meant to write a comment such as "{old-state-value} (...) {new-state-value}",

Unfortunetely i can't find a way to get "old-state-value", so my action won't work. I've tried to use `ctx.issue.fields.oldValue(ctx.State)` - which works great with 'onChange rule' - but it doesn't work with action rule.

Is there any way to get that old value in action rule?


1 comment
Comment actions Permalink
Official comment


The oldValue returns the previous value only if it was changed in the current transaction. Otherwise, it returns null. So, it is possible to get the field old value only if it was changed the same action rule.

As for the value specified in the issue history, the workflow does not have access to this. Please feel free to vote for this feature request: Provide access to issue history in workflow to increase its priority and to receive the updates.

Should you have any further questions, feel free to contact us.

Please sign in to leave a comment.