Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Unable to assign ticket to a user / API / Python

Franz Hellriegel
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
February 14, 2020

Hi,

 

I have written a script to create projects with issues in Jira. The scrip uses this Python lib: https://jira.readthedocs.io/

My problem now is that I can't assign tickets anymore - I am getting this error:

„Konto-ID“ muss der einzige Abfrageparameter für die Identifizierung des Benutzers im strengen Modus der DSGVO

The script and also the assigning tickets to Jira users worked a few days earlier. Nothing change in the script. I am using the cloud version

 

The complete error I am getting:

Traceback (most recent call last):
  File "create_templated_jira_projects.py", line 100, in <module>
    jiraConnection.assign_issue("IM-102", "fhellriegel")
  File "/usr/local/lib/python3.8/site-packages/jira/client.py", line 126, in wrapper
    result = func(*arg_list, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/jira/client.py", line 1310, in assign_issue
    r = self._session.put(
  File "/usr/local/lib/python3.8/site-packages/jira/resilientsession.py", line 157, in put
    return self.__verb('PUT', url, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/jira/resilientsession.py", line 147, in __verb
    raise_on_error(response, verb=verb, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/jira/resilientsession.py", line 56, in raise_on_error
    raise JIRAError(
jira.exceptions.JIRAError: JiraError HTTP 400 url: https://artusinteractive.atlassian.net/rest/api/latest/issue/IM-102/assignee	text: „Konto-ID“ muss der einzige Abfrageparameter für die Identifizierung des Benutzers im strengen Modus der DSGVO sein.
	
	response headers = {'Server': 'AtlassianProxy/1.15.8.1', 'Cache-Control': 'no-cache, no-store, no-transform', 'Content-Type': 'application/json;charset=UTF-8', 'Strict-Transport-Security': 'max-age=315360000; includeSubDomains; preload', 'Date': 'Fri, 14 Feb 2020 16:40:45 GMT', 'ATL-TraceId': 'f9dacc9dcd4bc8ae', 'X-AACCOUNTID': '557058%3A64cf2f49-35f7-4cad-8fde-2f232794794c', 'X-AREQUESTID': '4a1592ef-4336-438c-99b5-4da6181ec30b', 'X-XSS-Protection': '1; mode=block', 'Transfer-Encoding': 'chunked', 'Timing-Allow-Origin': '*', 'X-Content-Type-Options': 'nosniff', 'Connection': 'close'}
	response text = {"errorMessages":["„Konto-ID“ muss der einzige Abfrageparameter für die Identifizierung des Benutzers im strengen Modus der DSGVO sein."],"errors":{}}

Does anyone has an idea what is going on?

 

Thanx for help   

3 answers

1 vote
Ajith
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
February 29, 2020

jiraClient = JIRA(URL, basic_auth=(EMAIL, ACCESS_TOKEN))
project_name = "TEMP"
summary_value = "test"
description_value = "description"
accountId = "your_account_id"
c = jiraClient.create_issue(project=project_name, summary=summary_value,description=description_value,
issuetype={'name': 'Task'},assignee={'accountId': accountId})
print(c.key)

Anton Usov February 29, 2020

Hi there!
Can you explain, please.

Anton Usov March 2, 2020

Thank you very much!

It works as you described. Now there is no problem to create. But you cannot assign already created tasks. 

subrahmanya sarma chelluri
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
June 3, 2020

hi usov_a,

please use below for the already created task

issue = jira.issue(jira_number)

issue.update(assignee={'accountId': '5bf55bxxxxxxxxxxb4d49f32'}

Like # people like this
0 votes
Anton Usov February 14, 2020

I read this article
https://docs.automationforjira.com/knowledge-base/convert-usernames-to-user-account-id.html#who-this-guide-is-for

 

And tried to use userID. But I'm still receiving the same error.

Anton Usov February 14, 2020

"Operations that currently use a username and/or userKey as a search clause (for example, JQL queries) will also use an Atlassian account ID (accountId). After the deprecation period ends, only an accountId may be used. To help you update your JQL queries, we’ve introduced a new operation: POST /rest/api/3/jql/pdcleaner which takes one or more JQL queries with user identifiers and converts them to equivalent JQL queries with account IDs."

So as I understand JIRA do not accept usernames anymore, but they did not changed JIRA python libriary.

Anton Usov February 14, 2020

Updated package to the latest version. Still no luck.

Ajith
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
February 29, 2020

I had pasted the below code which worked for me. Please check and let me know.

Like Anton Usov likes this
0 votes
Anton Usov February 14, 2020

I'm having exact same issue! No changes in the script. And I've got the exact same response text. 

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events