Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

how to get user authorization for Jira Automation web requests and use it for next web requests

Dmytro Shaforost
Contributor
January 17, 2024

I need to create a automation rule with two step by step web requests.

First one should get my account authorization info (e.g. token) set it to variable and used for next web request...

1. rest/api/latest/user/search?query={{ReportingUser.urlEncode}}     (I can't understand what i need to enter instead of {{ReportingUser.urlEncode}} to get my user info and what i need to choose from answer to get the authorization data for next request)

2. /rest/api/3/workflowscheme/project/?projectId=   (how i should use authorization parameters from previous request)

 

Thanks a lot!

1 answer

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.
January 17, 2024

Hi @Dmytro Shaforost 

What problem are you trying to solve by dynamically changing the REST API call authorization from an automation rule?  I do not believe that is a capability of rules, but instead something more likely done from an application calling the REST API functions.

For your first question, the user's account ID value is needed for a user search: https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-user-search/#api-rest-api-3-user-search-get

Kind regards,
Bill

Dmytro Shaforost
Contributor
January 18, 2024

I need to call request for getting info about project scheme, but when i try to validate it in jira automation rule i get the unauthorized error and, as i understand i need to get some user data before for authorization

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.
January 18, 2024

Looking at the documentation, that function requires the Administer Jira permission, and so the token for the request would need to be for a user with that permission, and not one dynamically provided from another user.

https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-workflow-scheme-project-associations/#api-rest-api-3-workflowscheme-project-get

Suggest an answer

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

Atlassian Community Events