Our new Appfire Documentation Space is now live!

Take a look here! If you have any questions please email support@appfire.com

Code snippet to get the date, time when the issue was moved to a specific status

Requirement:

Nunjucks code snippet to retrieve the date, time when the issue was moved to a specific status.

Solution:

If the issue was moved to the desired status multiple times:

Case 1: Code to get the date, time when the issue was last moved to the desired status:

{{ issue | fieldHistory("status") | filter(["to_string","STATUS_NAME"]) | last | field("date") | date }}

Case 2: Code to get the date, time when the issue was first moved to the desired status:

{{ issue | fieldHistory("status") | filter(["to_string","STATUS_NAME"]) | first | field("date") | date }}

Replace STATUS_NAME with the desired status name (as-is → case sensitive and no trailing/leading white spaces)

This Nunjucks code can be added in workflow post-functions (and Actions)

References