I'm trying to create a python script that will deactivate a jira user if they have left our employment. I'm trying to call the Jira cloud REST API but when I call the users/email?accountId I get returned a 404 error, it's specifically odd because I start off the fuction with a call that lists all the users, then I pull that data into a for loop which will start using the accountID and I don't get a 404 error there... what am I doing wrong?
here is a github gist to show you what I'm trying to accomplish... hopefully it helps...https://gist.github.com/reubendevries-cta/1b1edf6000ad10278e15ac8173e745a3
Hi Reuben,
Welcome to the community! I hope you are having a nice day.
I'm not able to completely test your script, but from what it seems, I believe that the issue might be associated with the URL.
You can check the documentation here.
Please correct me in case I'm wrong, but apparently, you are building the URL like the following:
https://organizationspace.atlassian.net/rest/api/3/ + users/email + params
However, instead of users/email, the right format would be something like the following:
https://organizationspace.atlassian.net/rest/api/3/user? + accountId=
Could you please check the documentation and give it a try and let us know how it goes?
Looking forward to hearing from you.
Regards,
Carlos
Hi @carlosughini ,
Thanks for the reply. Your looking at the delete user call. At this exact moment I want the person's email - eventually after I've matched the email address (which I will be passing through a python argument parse command), then I will use the delete curl request command a bit lower down in the function (I've yet to complete that part) . The reason for this is that a person's email is usually a pretty good unique identifier across multiple different platforms (O365, AWS, GitLab, and Atlassian) that we utilize. I hope this helps you understand my process. That being said if you look at the params section in the requests: http for humans documentation it will automatically append the "?" to the query portion of the API call.
Are you still facing this issue?
Could you please get one specific use as an example and try to perform the request maybe using postman or the terminal by using the accountId?
I understand that using an email address is easier, however, some changes were made, for privacy reasons, which removed certain details that used to work on API calls. The E-mail address is one of them, so I think if you could try the request directly via postman or terminal and using one user as an example you could confirm if the issue is in the script, params or even the endpoint.
@carlosughiniI'll look at it tomorrow morning, my workday is done for the day- so from what I am understanding from you the API call to grab the user's email address is no longer valid? That's disappointing... I guess I could try add another parameter in my script and user the username...
It looks like you're new here. Sign in or register to get started.