Forums

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

Assign myself to new Jira issues, by using a Python script.

Deleted user February 17, 2020

Hi all,

I have been using a Python script someone else wrote for me, to import Trello cards into Jira.

I love that script, but there is a small update I'd like to do, and that is: Assigning all imported card to myself in Jira.

I have being trying different things an reading other questions and solutions, but I can't figure it out. (I am not a dev myself).

Knipsel.PNG
Above is part of my code. The assignee row is the 1 row I've added, and since the code is broken. So I think I've done something wrong.
(I've hidden part of my user ID, because I don't know if this is sensitive information)

The code:

+ ', "assignee":{"id": {557058:3911cfb9-4331-4994-8713-XXXXXXXXXXXX}'"}'

 Can someone tell me what I am doing wrong here, please?

 

Thank you!

 

Edit: The card created, is always "created by" me.
I guess this is because the "auth" uses my email address?

Maybe that helps.

1 answer

1 accepted

1 vote
Answer accepted
Dario B
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 18, 2020

Hello @[deleted] ,

 

I might not  be the best person to answer this question since I don't know python that much, but looking at the line added by you I can see that:

  1. there is an unbalanced single-quote
  2. the account-id is surrounded by curly brackets instead of double quotes
  3. If I call the rest/api/3/issue endpoint against any assigned issue in my instance I can see the syntax should be: 
    "assignee": {"accountId": "557058:70a51490-9608-499e-93a9-xxxxxxxxx"}

 

Can you kindly try to change it as below and see if it works:

+ ', "assignee":{"accountId": "557058:3911cfb9-4331-4994-8713-XXXXXXXXXXXX"}'

 

Also, yes, the issues are created by you since you use your account to authenticate the REST API calls.

 

Finally, for the future, please notice that this is not the best place to get help on development  related questions. The right resources are listed in https://developer.atlassian.com/resources. 

 

Specifically:

 

I hope this helps.

 

Cheers,
Dario

Deleted user February 19, 2020

"I might not  be the best person to answer this question"
Well, I think you are. Because it worked.

Thanks!

Like Dario B likes this
Dario B
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 19, 2020

You are very welcome @[deleted] !

I am happy to know it worked :) 

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events