How to capture and store the approval timestamp in a Jira custom field.
Platform Notice: Cloud - This article applies to Atlassian products on the cloud platform.
Summary
A method to automatically capture and store the approval timestamp in a Jira custom field.
Environment
JSM Cloud
Problem Description
The core issue was the need to automatically fetch and record the approval date and time when a ticket is approved in Jira, storing this information in a custom field named "Approval Timestamp". The challenge was to implement this functionality given that Jira does not natively support capturing approval timestamps directly into custom fields.
Cause
There is no built-in feature to directly capture and store approval timestamps in custom fields upon ticket approval.
Solution
- Create a custom field named "Approval Timestamp" of type Date Time Picker and associate it with the relevant project.
- Set up an automation rule with the trigger set to 'Approval completed'.
- Use the 'Edit issue' action within the automation to populate the "Approval Timestamp" field with the current date and time, utilizing Jira's smart values - "{{now.jiraDateTime}}" for date and time.
- Test the automation on a new ticket to ensure the "Approval Timestamp" field is correctly populated upon ticket approval.
- Note: This solution applies only to new tickets; it does not retroactively apply to tickets approved in the past.