Software Development and Programming Careers (Official Discussion Thread)

Obreh Winfrey

Truly Brehthtaking
Supporter
Joined
Nov 18, 2016
Messages
20,852
Reputation
25,810
Daps
132,033
Maybe a coli breh should help you :lolbron:
We ain't cheap
full
 

Sonny Bonds

Superstar
Supporter
Joined
Apr 24, 2014
Messages
4,919
Reputation
1,065
Daps
13,872
In Python

I'm connecting I've got 2 questions:
1. I'm connecting to the Jira API to pull ticket\issue data, how do I pull the all the comments for each issue?
2. How do I output JSON here?

from jira import JIRA
import requests
user = "jirauser"
apikey = "apikeyhere"
server = "https://insertnamehere.atlassian.net"

options = {
"server": server
}

jira = JIRA(options, basic_auth=(user,apikey))
size = 100
count = 0
while True:
start= count * size
project = "FINANCE"
issues = jira.search_issues("project= " + project, start,size)
if len(issues) == 0:
break
count += 1
try:
for issue in issues:
print("ticket-no: ", issue)
print("IssueType: ", issue.fields.issuetype.name)
print("Status: ", issue.fields.status.name)
print("Summary: ", issue.fields.summary)

except:
print("Error")
continue

I got daps, reps, and coli cash.
 

Obreh Winfrey

Truly Brehthtaking
Supporter
Joined
Nov 18, 2016
Messages
20,852
Reputation
25,810
Daps
132,033
In Python

I'm connecting I've got 2 questions:
1. I'm connecting to the Jira API to pull ticket\issue data, how do I pull the all the comments for each issue?
2. How do I output JSON here?



I got daps, reps, and coli cash.
jira.resources — jira-python 0.1.dev50+g7fa3a45 documentation
For 1 it looks like you can do something like
for c in issue.fields.comment:
# Do what you want with each comment
For 2 are you trying to get JSON from Jira? Or print your own JSON?
 

Sonny Bonds

Superstar
Supporter
Joined
Apr 24, 2014
Messages
4,919
Reputation
1,065
Daps
13,872

Sonny Bonds

Superstar
Supporter
Joined
Apr 24, 2014
Messages
4,919
Reputation
1,065
Daps
13,872
I still can't get these comments.

I'm also trying to use argparse to allow users to change the project variable via command line.

I hate this shyt.
 
Top