I created a script in Python that reads an underlying database table and updates a custom user field (Team Lead) based on new organization changes. I am having issues actually updating the user type custom field. I know Atlassian made changes to the structure of user fields to now use the accountId, but that still did not seem to work. Any help is appreciated.
I authenticate using user name and security_token which is set as a variable I call auth_jira to use throughout my script.
Code provided below:
LOG.debug('Updating candidate Jira issue team leads...')
for ix, row in acct_lead_df.iterrows():
LOG.debug(f"{row['key']}|{row['issueType']}|{row['acctTeamLead']}")
auth_jira.issue(row['key']).update(fields={'customfield_10268': [{'accountId': row['id']}]})
Welcome to Community! I believe your payload might be wrong, when updating a user, you shouldn't wrap the value in a list. you should do:
{'customfield_10268': {'accountId': row['id']} }
Let us know how it goes.
Hey @Prince Nyeche thank you for your response. This change seems to have it running correctly. Thank you!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Please DO NOT do this as you risk corrupting your database. Most importantly, Atlassian and most wouldn’t be able to support you if things go wrong.
Rather parse your request via rest api and update the custom field accordingly.
You can find the official api here: https://developer.atlassian.com/cloud/
Click Rest API link for the correct product you use(I suspect you use server/dc since you mentioned a database).
Cheers.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hey @Ismael Jimoh thank you for the response. Sorry for not being clear here. I am using Jira Cloud not server. Our Jira data is exported to an Aurora Data lake that we leverage for several downstream processes. I will take a look at the documentation you provided.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.