Request body received by REST API (using Jira Automatioin) doesn’t have user info who transitioned

durgaprasad.patlolla
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
March 7, 2022

Hello Atlassian community 

 

What’s our Use-case - Invoke/Trigger REST API with task metadata when status of task moves from X to Y

 

In our use case, we have a workflow with various states like TO DO -> Approved -> Access Given -> Access Revoked (Done). We integrated JIRA automation with this workflow that triggers a rest API (Authenticated) on moving Jira ticket status from TO DO -> Approved and we were successful in reaching this point. 

 

The body request body received by rest API contains almost very much info we needed like assignee, reporter, various custom fields but the only thing that seems to be missing is the info of the user who transitioned the Jira from To Do -> Approved. 

 

Lets say UserA, UserB, UserC have access to move the Jira from To Do to Approved, and DeveloperA (Reporter) has created a Jira ticket with various fields and assigned it to UserA (Assignee) but UserB has moved the status of jira ticket from To Do to Approved. In this case REST API is invoked upon moving the state and body received doesn’t contain any information related to UserB who actually transitioned it.

 

Things we tried - 

Created a new component that populated one of the user type custom field (Approved by) and then invokes api. Question 1 - What this field has to be mapped to? Ideally, this value has to be the user who triggered the event, but this is not available in the drop-down. For testing purpose, we populated a static value (User) and tested the use case. We are receiving value as null, in the request body for this custom field but the same static value is shown on UI, please refer to below screenshots (approved_by_component.png, approved_by_component-2.png, approved-by-component-on-ui.png ).

 

approved_by_component-2.pngapproved_by_component.pngapproved-by-component-on-ui.png

 

To verify if the custom field is populated or not before invoking API, we created an if condition, as Approved by equals to the user (same user set in above components) and tested the workflow it gave error Condition, doesn’t meet the requirements, which means the value is not set in the component and state flow directly jumps to if condition. please refer screenshot (if-condition.png )

 

if-condition.png

 

What we required - What more needs to be done in the automation setup that gives us the user info who transitioned the Jira ? Please help us to identify this.

 

0 answers

Suggest an answer

Log in or Sign up to answer