Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

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

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

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.

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

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

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you