How to identify using REST API

jasper_hoevenaars November 2, 2023

I'm trying to fetch issue data in a jira automation. The issue is in a different project than the trigger issue, hence I need to use the REST API in automation by means of a web request to get the issue data. However, I get the error that I am not authorized to access the issue. How do I do proper authorization?

snip3.PNG

Now the string after basic is a base64 conversion of my username:password. And I've also tried Jira token. This gives the following error:

snip4.PNG

1 answer

0 votes
Andreas Alexandrou November 2, 2023

Hello Jasper, 

I assume you have already generated a token to use for your web request in the automation correct? For this to work, the user with whom you generated the token needs to have the appropriate permissions in the project.

You could create a user dedicated for running automations, generate a token with that user and grant that user permissions to view the issues in the project.  

Hope this helps.

Kind regards,
Andreas Alexandrou

jasper_hoevenaars November 2, 2023

Hello Andreas,

Thanks for helping.

In this case, I am the user with the access and I created the token. Should what I do then work or am I applying it in the wrong way?

Andreas Alexandrou November 2, 2023

Hello Jasper,

If your user does not have access to view tickets from that project then your web request will not be successful.  For this to be successful:

1. your user must be granted permissions to view the issues on that project

OR

2. use a different user that already has access to that project to generate a token and use the username and token generated by that user in your automation

jasper_hoevenaars November 2, 2023

The user (that is me) has access

Andreas Alexandrou November 2, 2023

Is the url correct?

jasper_hoevenaars November 2, 2023

The URL is correct, when checked with a API tester I am able to fetch the issue details, even without authentification.

jasper_hoevenaars November 2, 2023

I have good news, the above problem is solved. The personal access token was wrong. Apparently you need to create one via your profile --> personal access tokens

However, now how do I use this information in the rest of my automation?

How do I now access for example the Team field of the just fetched issue?

Suggest an answer

Log in or Sign up to answer