Skip to content

Commit

Permalink
SVCPLAN-6226 update customfields for new jira
Browse files Browse the repository at this point in the history
  • Loading branch information
andylytical committed Sep 12, 2024
1 parent dc53bdd commit ab9eb31
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 24 deletions.
22 changes: 4 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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/
```
8 changes: 6 additions & 2 deletions jiracmdline/jira_connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
11 changes: 7 additions & 4 deletions jiracmdline/libsprint.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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:
Expand All @@ -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' ):
Expand Down

0 comments on commit ab9eb31

Please sign in to comment.