I added a custom field "rework_count" and tried to add 1 every time people reopen the issue. I added a POST function to the transition.
But I got an error "transition failed". Please let me know if there is an issue with my expression.
Hi @Wei Zhang ,
If you don't work with Jira Automation you could also try our Jira cloud app Dynamic Fields for Jira.
With our app you can create a field "rework_count" that counts how many times an issue was reopened.
This is how your custom expression could look like:
issue.changelogs.filter(changelog => changelog.items.some(item => item.fieldId == 'status' && item.toString == 'Reopened')).length
Replace "Reopened" with the name of the status you'd like to count. You can also use item.to and the status' ID instead.
If you need support in creating your custom dynamic field, don't hesitate to get in touch with our support.
Hi Wei,
You should create that as an Automation For Jira rule and not do it in the post function in this case.
So create an Issue Transitioned trigger rule.
Then add any conditions you might want.
Then add a New Action for Edit Issue.
Select the Rework Count field and add your above code into that field.
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.