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

Search of Issue Key with REST API

Sebastian Schwab July 1, 2013

I'm using python to perform a search in JIRA via RESt API and the requests library, just like that:

search = {"jql": "project=EFFSB", "startAt": 0, "maxResults": 100, "fields": ["key", "summary", "description","status", "duedate", "assignee"]}
r = requests.post(url, auth=(user, pw), data=json.dumps(search), cookies=cookies, headers=headers)

With the pulled data I fill an array:

for element in r.json()["issues"]:
JiraArray.append([element["fields"]["key"], element["fields"]["summary"], element["fields"]["description"], element["fields"]["status"]["name"],element["fields"]["duedate"], element["fields"]["assignee"]["displayName"])

All of that works perfectly fine, as long as I don't want to pull the issue key (which you can search in the advanced search by "key = ABDCEF_1234"), like presented in the code.

Without the "key" string, everything works as it should.

How can I pull that data?

Thanks a lot!

Sebastian

2 answers

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

0 votes
Answer accepted
Sebastian Schwab July 8, 2013

Thanks, but that didn't help me that much.

But I found an answers myself today:

For the issue key I have to call "element["key"]" because the key is locked to the element not to "fields".

0 votes
LucasA
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 6, 2013

Hi Sebastian,

Maybe this doesn't sove your issue, but could put some light on: https://bobswift.atlassian.net/wiki/display/ACLI/Atlassian+Command+Line+Interface

Cheers,

Lucas Lima

TAGS
AUG Leaders

Atlassian Community Events