Previous value of workItem

Hello,

ctx.issue.editedWorkItems contains edited workItems. But how to find out the previous value of workItem that was before the change?

Thanks

0
2 comments
Official comment

Hi!

I'm Sergey from the YouTrack team.

You can use an oldValue() method of the IssueWorkItem entity: 

ctx.issue.editedWorkItems.forEach((item) => console.log(item.oldValue('duration'))) // prints previous duration in min

If you have any questions, please let me know. 

Please sign in to leave a comment.