Remove either the label use-case-smart-text or use-case-smart-number depending on the feature the use case is based on

Use case

Return the number of days that the issue spent in the previous status.

Expression

Create and configure a Smart field using this expression in Jira expression mode:

let statusChangelogs = issue.changelogs.filter(changelog => changelog.items.some(item => item.fieldId == 'status'));
statusChangelogs[0] ? (statusChangelogs[0].created.getTime() - (statusChangelogs[1] ? statusChangelogs[1].created : issue.created).getTime()) / (24*60*60*1000) : null


 

Feature

Field type

Smart number field

Parsing mode

Jira expression

Expression
let statusChangelogs = issue.changelogs.filter(changelog => changelog.items.some(item => item.fieldId == 'status'));
statusChangelogs[0] ? (statusChangelogs[0].created.getTime() - (statusChangelogs[1] ? statusChangelogs[1].created : issue.created).getTime()) / (24*60*60*1000) : null
Label
Use case description

Return the number of days that the issue spent in the previous status.

Complexity