Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

How to use JIRA API to change the transitioner of status as another user

Sughosh Kulkarni October 14, 2021

I am using Python and JIRA API to change a status from To Do to In Progress.

The problem I am facing is that the transitioner is set to me because I am using my credentials. Is there a way to change the user to asignee?

 

I am using the below code in Python.

 

jira_session.transition_issue(issue, status)
# Issue is the Issue Key
# Status is a string containing the code for transition. Example: '151'

1 answer

2 votes
Mohamed Benziane
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
October 14, 2021

Hi,

Welcome to the community.

No you can't, what you can do with the API is what you can do using the UI. So unless you change the account the transitioner will be you in this case.

So i don't know your use case but it sound like a bad practice.

Sughosh Kulkarni October 29, 2021

Okay, thank you.

The use case is that we are updating the transition of status from python using the API. But the updates are coming out in my name.

The reporter gets an email stating that I transitioned the status to something ("resolved" for example)

I was wondering if there was a way to make the transition to be the assignee. 

But anyway, thank you for your answer. 

Mohamed Benziane
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
October 30, 2021

In this case, you could create a generic account, something like "jira_admin" that you will use in your python script.

Lakshmi Narasimha Murthy Annavajhula September 15, 2022

Hi @Sughosh Kulkarni I am also trying to do the same. In my case I am trying to change the transition of the issue from backlog to resolved as part of testing but I couldn't do it there is an error stating as below. any help would be highly appreciated. Thanks

response text = {"errorMessages":["It seems that you have tried to perform a workflow operation (Resolve Issue) that is not valid for the current state of this issue (TOOLSENG-3701). The likely cause is that somebody has changed the issue recently, please look at the issue history for details."],"errors":{}}

Sughosh Kulkarni September 15, 2022
You can use this code.
from jira import JIRA
jira_cred = ("YOUR_EMAIL", 'YOUR_TOKEN')
jira_session = JIRA(server=server, basic_auth=jira_cred)
# Use this code to get the all the transition codes available along with their status names
issue = jira_session.issue('TOOLSENG-3701')
transitions = jira_session.transitions(issue)
print([(t['id'], t['name']) for t in transitions])
# Transition status using the below code
jira_session.transition_issue("TOOLSENG-3701", "STATUS_ID")
Lakshmi Narasimha Murthy Annavajhula September 15, 2022

Thanks for the quick reply I have used the same code but I am getting the error as mentioned above and not able to change the issue status. I have checked the status its still showing as Backlog only not updated.

Sughosh Kulkarni September 15, 2022

I would confirm if the transitions are connected between status and working as expected.

 

Here is a similar issue with a resolution.

 

https://confluence.atlassian.com/jirakb/workflow-action-invalid-error-thrown-when-moving-an-issue-between-columns-on-jira-agile-board-779159167.html

Lakshmi Narasimha Murthy Annavajhula September 15, 2022

I would confirm if the transitions are connected between status and working as expected.

I didn't understand the above part. IS the error occurring because the issue is still in the 'Backlog' and not in the active status. 

Sughosh Kulkarni September 15, 2022

There might be issues with the transition between the two statuses. Delete the transition and create another one. Then maybe it will work fine.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
TAGS
AUG Leaders

Atlassian Community Events