We are in Jira Cloud, Jira Service Management, project is Team Managed.
I am trying to get all information regarding the user from user name. I need account id, email address etc.
I receive empty body but API GET request works as intended from the browser:
In the response I only get header and not the body. The body is empty. The request status is 200 and I get all the header information but then "body[ ]". Again, this works in the browser.
Hello @IT Brute
What API endpoint are you using?
Can you share with us the configuration of the Send Web Request action? Obscure confidential data but otherwise provide all the details, please.
Hi @Trudy Claspill mentioned below is the screen shot.
I am trying to get the account id of the users mentioned as display names (not as user names). When users are mentioned in an email reply they come into Jira as display names. The idea is to extract the mentioned names in the email replies and add the users to a custom field. I can extract the display name, store it in a variable, this variable is {{getSingleValue}}
I have tried just using the user name for 'query' parameter in the URL and result is the same where 'body' is empty
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you for that additional information.
I think I have identified the problem.
Send Web Request actions do not automatically execute the API call as the Actor of the rule.
In the Headers section of the action you have not provided an API token for the web request, so the API is being executed Anonymously.
As per the API documentation for the endpoint:
Permissions required: Browse users and groups global permission. Anonymous calls or calls by users without the required permission return empty search results.
You will need to provide an API token generated by a user account that has the Browse users and groups Global Permission in order to get data back.
Here are instructions for generating an API token.
This community article talks about how to encode a token and then add it to the Headers of the Send Web Request.
Let me know if you have any questions.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @IT Brute
You will need to use the smart values {{webResponse.body}}
To drill further into the body, use {{webResponse.body.<value>.<value>}}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Marc -Devoteam- the body is empty as you can see from the screenshot I posted with my question.
I store the value of weResponse.body in a variable and when I log action, the variable has no value. Screenshots below
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @IT Brute
See @Trudy Claspill explanation.
Sending a web request requires to be done by a user, for this user an API token has to be created and set in the header of the web request action in the automation rule.
The provides links will lead you to the information you need,
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.