Automation for Jira : How get the approver completed date.

Rita K Landis February 26, 2024

I'm creating an automation email to show the status of all the approvals.

I'm able to get the displayName and approverDecision, but completedDate does not return a value.

Here is what I am using:

 

{{#issue.fields.Approvals.approvers.get(0)}} 
       {{approver.displayName}} {{approverDecision}} {{completedDate}}
 {{/}}
 
{{#issue.fields.Approvals.approvers.get(1)}} 
       {{approver.displayName}} {{approverDecision}} {{completedDate}}
 {{/}}

 

Also, I'm not really sure why this is working :)

We have a custom field flor the approvers, but this (below) doesn't return any value

{{issue.customfield_15606.approvers.get(0).approver.get(0).displayName}} - 

Any help would be appreciated,

 

Thank you

2 answers

0 votes
Rita K Landis February 27, 2024
 

 

0 votes
Kalyan Sattaluri
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 26, 2024

Hello @Rita K Landis 

Without seeing the fields within this customfield, it is hard to suggest. I am assuming your reponse is like here

Please try to log below values and let us know if any of them give you the data:

{{customfield_15606.completedDate}}

{{customfield_15606.completedDate.jira}}

{{#if(equals(customfield_15606.finalDecision,"approved"))}}{{completedDate}}{{/}}

{{#if(equals(customfield_15606.finalDecision,"approved"))}}{{completedDate.jira}}{{/}}

 

{{#issue.customfield_15606}}{{#approvers}}{{#if(equals(approverDecision,"approved"))}}{{completedDate.jira}}{{/}}{{/}}{{/}}
If none of the above work, can you, in your browser, put in below URL and hit enter and share relevant section of customfield_15606 to understand your response/
https://<your_domain>.net/rest/api/3/issue/<issue_key>

 

Rita K Landis February 27, 2024

Hi Kalyan,

 

Thank you for your response. None of the suggestions provided any data. I entered the URL and 

customfield_15606":null
was returned

Kalyan Sattaluri
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 27, 2024

Hello @Rita K Landis 

Sorry about that. I thought customfield_15606 was for Approvals. Maybe try for Approvals field in above response instead? Just curious.

BTW, Can you tell what is the trigger for your automation rule?

If your trigger is Approval Completed, then you can use {{approval.completedDate}} along with other smart values for approver and decision as listed here.

If you trigger is something else, I have read that you dont have access to the completed date. You will need to either -

  • Using automation, Store these dates in a custom field whenever approved so you can use it later in your subsequent rules.
  • Or, see if below URL shows you completed date. If so, you can make a rest call and get this data. To test this route, please complete below URL and put it in browser and hit enter

htpps://youdomain.net/rest/servicedeskapi/request/{issueIdOrKey}/approval

 

Rita K Landis March 1, 2024

Thanks for your help, Kalyan.

I'm running the automation manually, so that seems to be the issue with not getting the date back. 

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events