Which API end point to check if a user has create issue or add comment in a project

m.fairholm November 29, 2021

Hi, I am trying to get a true or false return for a user if they have CREATE_ISSUE permission in a project.

I've tried endpoint https://my-sever.atlassian.net/rest/api/3/permissions but I cannot figure out what I need to add as a body or add to the end of the url to get the permission for a particular username.  The username would be an email address.

 

I also tried https://my-server.atlassian.net/rest/api/3/mypermissions?permissions=ADD_COMMENTS,CREATE_ISSUES

but this is only returns results for my permission.

 

Many thanks

Max

1 answer

1 accepted

2 votes
Answer accepted
Prince Nyeche
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.
November 29, 2021

Hi

You can look into this endpoint for find user with permission. However, take note that you will need to pass an accountId and not username as username are deprecated on cloud. If you want to use an email address, then you will need to have a sort of lookup table where your script or program needs to refer to and get the necessary accountId of a particular user. I believe that should help you know if a user has such a permission or not.

m.fairholm November 29, 2021

Thanks Prince, this worked.  However, it would be nice if it returned true for false if a user has CREATE_ISSUES permission.  Instead it details all the permission  user has.  Unless I am formulating the call incorrectly.

Max

Prince Nyeche
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.
November 30, 2021

You should format the response in your own way that it returns true or false. I believe false response should be when the payload returns an empty list or no value at all. The true response returns a mapping of the data content.

Suggest an answer

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

Atlassian Community Events