From ab9eb3164850326026f952a2effc3885d8f692a0 Mon Sep 17 00:00:00 2001 From: Andy Loftus Date: Thu, 12 Sep 2024 08:07:59 +0000 Subject: [PATCH] SVCPLAN-6226 update customfields for new jira --- README.md | 22 ++++------------------ jiracmdline/jira_connection.py | 8 ++++++-- jiracmdline/libsprint.py | 11 +++++++---- 3 files changed, 17 insertions(+), 24 deletions(-) diff --git a/README.md b/README.md index ee38dc7..fa3c825 100644 --- a/README.md +++ b/README.md @@ -58,22 +58,8 @@ bash ./go_jira.sh ``` # Dev Setup -1. Start Docker container -``` -git clone https://github.com/ncsa/jiracmdline -cd jiracmdline -./go.sh -# now inside container -cd /home/working/jiracmdline -./devsetup.sh -``` -1. Run test (inside Docker container) -``` -cd /home/working/jiracmdline -./run.sh test.py -``` -1. Run live iPython notebook (inside Docker container) -``` -cd /home/working/jiracmdline -./jirashell.sh +1. `git clone https://github.com/ncsa/jiracmdline` +1. `cd jiracmdline` +1. `docker compose -f build.yaml` +1. Browse to http://localhost:8080/ ``` diff --git a/jiracmdline/jira_connection.py b/jiracmdline/jira_connection.py index f248095..e76b9e9 100644 --- a/jiracmdline/jira_connection.py +++ b/jiracmdline/jira_connection.py @@ -61,9 +61,11 @@ def get_labels( issue ): @staticmethod def get_epic_key( issue ) : ''' Epic that this issue is a part of + In jira, this is customfield "Epic Link" and is unique per instance ''' try: - key = issue.fields.customfield_10536 + # key = issue.fields.customfield_10536 #jira-old + key = issue.fields.customfield_10102 except AttributeError: key = None return key @@ -73,9 +75,11 @@ def get_epic_key( issue ) : def get_epic_name( issue ) : ''' The name of the epic. Assumes "issue" is an epic. If "issue" is not an epic, return None. + In jira, this is customfield "Epic Name" and is unique per instance ''' try: - name = issue.fields.customfield_10537 + # name = issue.fields.customfield_10537 #jira-old + name = issue.fields.customfield_10104 except AttributeError: name = None return name diff --git a/jiracmdline/libsprint.py b/jiracmdline/libsprint.py index 455f6d3..82519d6 100644 --- a/jiracmdline/libsprint.py +++ b/jiracmdline/libsprint.py @@ -8,14 +8,14 @@ class Sprint: ''' Python representation of a Sprint ''' id: str - rapidViewId: int + # rapidViewId: int #these might be null, not using it anywhere yet state: str name: str startDate: str endDate: str completeDate: str activatedDate: str - sequence: int + # sequence: int #might be null, not using it anywhere yet goal: str autoStartStop: bool @@ -37,7 +37,10 @@ def get_active_sprint_name( issue ): def get_sprint_memberships( issue ): - memberships = issue.fields.customfield_10535 + ''' In Jira, this customfield is named "Sprint" and is unique per instance + ''' + # memberships = issue.fields.customfield_10535 #jira-old + memberships = issue.fields.customfield_10101 sprints = [] if memberships: for line in memberships: @@ -46,7 +49,7 @@ def get_sprint_memberships( issue ): def _str_to_sprint( line ): - ''' Parse a line from customfield_10535 + ''' Parse a line from customfield "Sprint" return an instance of a Sprint ''' if not line.startswith( 'com.atlassian.greenhopper.service.sprint.Sprint' ):