Hi, Could help please?
Requirement: using forms Text field to add participants for JSM request.
Solution: using automation rule, get the email address from forms Text field, then using "send web request" to get the account ID, then add the account ID to request participants.
p1: automation rule
Problem: Got the error 403 as blow.
p2: error 403
My question: 1. do you know how to solves this problem? 2. do you know the account or token which sent the API?
Hi @Vina Wu
First, are the mentioned email addresses from existing users, as the endpoint you are accessing is to get users in the system.
As @Kai Krause mentions, adjust your call, as it is incorrect
These need to be users, so no a JSM customer only, also these users need to be active (they have been invited or added and have accepted the invite or logged in once)
If you want to get existing customers, use https://developer.atlassian.com/cloud/jira/service-desk/rest/api-group-servicedesk/#api-rest-servicedeskapi-servicedesk-servicedeskid-customer-get
To add Request participants by automation, you need their account ID, to add them.
See; add-update-remove-request-participants-using-automation-in-jsm-cloud
Example on getting account ID.
Thank you very much both @Marc -Devoteam- @Kai Krause .
Yes, these users are active in Jira.
Seems the API is working now after setting as you said.
but the account ID seems can't be added. could you please help check if my next action/edit work item is correct(actually i copy from Manage Request Participants with Automation in JSM Cloud | Jira and Jira Service Management | Atlassian Support)?
P3: "Send web request"
P4: "edit work item"
P5: "audit logs"
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi, i think you have to use
{{webResponse.body.first.accountId}}
to get the accountId from the response from the api., because you get an array back.
BR
Kai
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Vina Wu
What is the response of the web request.
Can you log this, as it seems there is no valid response.
What if you make the request in a browser window, using the URL and the mail address provided in the field.
Is you variable in the branch also set to {{EMAIL}}, naming needs to be correct in the web request on the variable name from the branch action.
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- thanks for the suggestions.
I tested the URL with actual email in both JSM and browser. and found that JSM responded blank and browser could response account id. Could you please advise again? thanks.
rule and log in JSM:
response from browser:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Vina Wu
What is the configuration in your branch action in the automation rule?
You are creating a smart value there {{smartvalue}}, you need to use this smart value in the API call (mind capitals).
What is the full url for the API call? (you can hide your domain part)
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- thanks.
please see the detail Branch rule as blow. and new logs for this rule.
URL is :https://xxxxxxxx.atlassian.net/rest/api/3/user/search?query=vinaxxxxx.com
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Vina Wu
Change authorization value:
to Basic and your key, als add key Content-Type and values Application/JSON, also for Accept.
The greyed out options are not taken.
See my screenshot.
There is something wrong in your web request details, as the browser provides feedback correctly
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Marc -Devoteam- thanks you very much.
does authorization value Key means "Basic base64(my email : my API token)"?
and the token should be get from below button. right?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The token you already use, did you convert this to base64?
No typing it like this in authorization doesn't make it base64.
Convert your created api token related to your email, for example here; https://www.base64encode.org/
On this site input my email:my API token, the result should be set as Basic result in the authorization
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
i think
you have to call
https://<yoururl>.atlassian.net/rest/api/3/user/search?query={{EMAIL.urlEncode}}
with empty body as get and in the headers Authorization with a Basic < Base64-Api-Key
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.