Jira python and custom field Edited

hello 

I want to get only the Sprint's name of an issue using jira-python

when I Type

issue.fields.customfield_10006

the answer I get is 

['com.atlassian.greenhopper.service.sprint.Sprint@2119aef0[id=111,rapidViewId=14,state=FUTURE,name=Sprint 18-S08,goal=,startDate=<null>,endDate=<null>,completeDate=<null>,sequence=111]']


How can I just get 'Sprint 18-S08' ?

I tried issue.fields.customfield_10006.name but it doesn't work

 

2 answers

1 accepted

This widget could not be displayed.
Shaun Seaver Atlassian Team Apr 06, 2018

Hi Christophe,

 

I was able to accomplish this with a bit of regex that filters out the extra data. Hope this helps.

 

issues_in_project = jira.search_issues('project=ALPHA AND SPRINT not in closedSprints() AND sprint not in futureSprints()')


for value in issues_in_project:
for sprint in value.fields.customfield_10006:
sprint_name = re.findall(r"name=[^,]*", str(value.fields.customfield_10006[0]))
print sprint_name
This widget could not be displayed.

Does issue.fields.customfield_10006['name'] work?

no :-(  it doesn't

neither issue.fields.customfield_10006[x]

Suggest an answer

Log in or Sign up to answer
Atlassian Summit 2018

Meet the community IRL

Atlassian Summit is an excellent opportunity for in-person support, training, and networking.

Learn more
Community showcase
Posted yesterday in New to Jira

Are you planning to trial, or are currently trialling Jira Software? - We want to talk to you!

Hello! I'm Rayen, a product manager at Atlassian. My team and I are working hard to improve the trial experience for Jira Software Cloud. We are interested in   talking to 20 people planning t...

81 views 1 0
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you