Automation - API request not returning accountID
Asked by Daniel Tardif Hernandez:

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](https://community.atlassian.com/t5/image/serverpage/image-id/330702i2040F622ACD59C3B/image-size/large?v=v2&px=999 "Screen Shot 2024-06-19 at 18.21.28 PM.png")

![Screen Shot 2024-06-19 at 18.28.52 PM.png](https://community.atlassian.com/t5/image/serverpage/image-id/330703iA167ED42D3F092EE/image-size/large?v=v2&px=999 "Screen Shot 2024-06-19 at 18.28.52 PM.png")

![Screen Shot 2024-06-19 at 18.55.02 PM.png](https://community.atlassian.com/t5/image/serverpage/image-id/330705i46DE96F6C65D9993/image-size/large?v=v2&px=999 "Screen Shot 2024-06-19 at 18.55.02 PM.png")


Answers:
author: Bill Sheboy
body: Hi [@Daniel Tardif Hernandez](/t5/user/viewprofilepage/user-id/5478141) -- 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


author: marc -Collabello--Phase Locked-
body: Hi [@Daniel Tardif Hernandez](/t5/user/viewprofilepage/user-id/5478141) ,

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.

comments: author: Daniel Tardif Hernandez
body: Hi [@marc -Collabello--Phase Locked-](/t5/user/viewprofilepage/user-id/1205132) ,

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](https://community.atlassian.com/t5/image/serverpage/image-id/330891i6D86709839555D26/image-size/large?v=v2&px=999 "Screen Shot 2024-06-20 at 09.55.44 AM.png")


author: Daniel Tardif Hernandez
body: Hi [@marc -Collabello--Phase Locked-](/t5/user/viewprofilepage/user-id/1205132) [@Bill Sheboy](/t5/user/viewprofilepage/user-id/1685313)

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


Tags: cloud

jira-cloud