Currently i have a user who has permissions on some projets , i use createWithBasicHttpAuthentication to connect it to the JIRA API , and i do have another user who has permissions on other projects , i need to get all the projects, but i can't find an intelligent way to connect both users in one call (or method) , does_it exist something like that ? Thanks
Hi Lina, welcome to the Community!
First I just want to double-check that API tokens are being used for both users. Details about how to use these with Atlassian Cloud are listed here. In short, you generate a new token from id.atlassian.com and use that in place of a password. The advantage to this is that you can have multiple tokens on your account (one per application) and they can be easily revoked!
Next, I'd approach the question from the perspective of security. If you are trying to authorize a script to connect as two different users, is there a particular reason for doing so? Could one user have permission on all the projects you need; either by adding permissions on one of two user accounts you already have, or perhaps just using a third account that has the appropriate permissions?
If two separate accounts must be used for some reason, I would suggest just using two calls in your script. You could write a method to connect and get details that accepts a username/API token as parameters, and pass whichever user you need at the particular time you need it. That way you only write one method, but you get flexibility in which user account is making the call. You'll have to work with the results twice, but it should be possible to structure a script around that.
Cheers,
Daniel
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.