Forums

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

I want to get all reporter names with issue id and summary from the json file

Rahul Singh April 1, 2018
import random
import sys
import os
import jira.client
import json
import logging
import datetime
import base64
import requests
import urllib
import json
from jira.client import JIRA
serverURL='http://ontrack-internal.amd.com'
query='project = SWDEV AND issuetype = Defect AND status in (Implemented, Rejected) AND "Deliverable ID" = "17.50 Sustaining [969960]" AND "Target SW Release" = "17.50 [694916]" AND status in (Implemented,Rejected) ORDER BY updated DESC'
jql='/rest/api/2/search?jql=%s' % urllib.parse.quote(query)
response=requests.get(serverURL+jql,verify=False,auth=("user","pass"))
print (response.json())

1 answer

0 votes
Shaun S
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 13, 2018

Hi Rahul,

If you're using the python-jira library you can use the raw option on results to have it returned in json format.  I was able to return search results in formatted json using the code below. 

 

import jira.client
from jira.client import JIRA
import json


jira_options={'server': 'http://ontrack-internal.amd.com'}
jira=JIRA(options=jira_options,basic_auth=('username','password'))

issues_in_project = jira.search_issues('project = SWDEV AND issuetype = Defect AND status in (Implemented, Rejected) AND "Deliverable ID" = "17.50 Sustaining [969960]" AND "Target SW Release" = "17.50 [694916]" AND status in (Implemented,Rejected) ORDER BY updated DESC')

for entry in issues_in_project:
print json.dumps(entry.raw,sort_keys=True, indent=4)

 Hope that helps!

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events