Automation - API request not returning accountID

Daniel Tardif Hernandez June 19, 2024

Hi all,

I've been trying to troubleshoot and find out why my Automation rule (which looks simple) is just not returning the accountID from the web request. The objective is to set the reporter from a short text field containing the "display name - email" of a user.

  • When an issue is created, I'm sending an API request which extract the email portion of the value from "Appelant" short text field. It follows the format "Display Name - email@example.com".
  • If the response accountID from that web request isn't empty, 
  • Then the Reporter needs to be that user from "Appelant". I used smart value {{webhookResponse.body.accountID}} to define it.
  • If any other condition
  • Then the reporter is set to a service account 

It seems that Jira doesn't find any users to correlate from that web request to insert it in Reporter.

I've tested the request with postman and it returns me informations just fine.

I've also added some return logs within the rule and there's nothing in the response body. Hence this, the service account always ends up as the Reporter.

Screen Shot 2024-06-19 at 18.21.28 PM.png

Screen Shot 2024-06-19 at 18.28.52 PM.png

Screen Shot 2024-06-19 at 18.55.02 PM.png

2 answers

0 votes
Bill Sheboy
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.
June 20, 2024

Hi @Daniel Tardif Hernandez -- Welcome to the Atlassian Community!

The image of the audit log details you show is not for the rule image you show.  There are no Log actions in the rule, and so you may be comparing two different things.

Regardless of that...

The audit log shows the condition check on {{webhookResponse.body.accountId}} is not empty is not passing.  And so it is likely either:

  • the rule checks the wrong location in the body, or 
  • no result was found

Which Jira REST API endpoint are you calling?  Is it this one: https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-user-search/#api-rest-api-3-user-search-get

 

Also I recommend writing the complete URL used for the Send Web Request action to the audit log.  That will confirm it is well-formed, and matches what you tried with examples in Postman.

 

Kind regards,
Bill

0 votes
marc -Collabello--Phase Locked-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
June 20, 2024

Hi @Daniel Tardif Hernandez ,

When you send a web request from an automation, the request will not have authentication credentials.  That means a web request to Jira (or Confluence) will usually fail because of an authentication error.  This is also seen in your log.

I don't know an alternative solution to your problem.

Daniel Tardif Hernandez June 20, 2024

Hi @marc -Collabello--Phase Locked- ,

Thanks for your input into this, I've resolved the authentication issue and added a log action. It looks like it extracts the email correctly but the response body is still empty

Screen Shot 2024-06-20 at 09.55.44 AM.png

Daniel Tardif Hernandez July 23, 2024

Hi @marc -Collabello--Phase Locked-  @Bill Sheboy 

Thanks for your answers, encoding my token to Base64 then applying it resolved the issue :) I just created the token then copy pasted it there, hence the authentication failing 

Like Bill Sheboy likes this

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
TAGS
AUG Leaders

Atlassian Community Events