tefoji 2.0.0 → 2.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/tefoji/jira_api.rb +37 -13
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2c2caf0e00b4916388f8bfb1db2b6ad61317558ed7495d2b39573670c3d7ebc1
|
4
|
+
data.tar.gz: 11f6804530ed3bdcdfa68ef5caeee1f34c070695646b228fa5842493a060732e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ed85494595e4f21db5a8cd26f8b556e29e496481611c6a1322621c495151b94d9ea253450ca2dc0db79493bf8bb74bf0e7c0674ed54ded1974614347e9f523be
|
7
|
+
data.tar.gz: 4c00b11dcb3ef0179838b5bbcac8fdeb1c808905fcf6f9f3236150999cb7a2f696171ff539ad1d6653252f3eabef01664dc36785855aa1d395684d3504646d80
|
data/lib/tefoji/jira_api.rb
CHANGED
@@ -329,24 +329,18 @@ module Tefoji
|
|
329
329
|
|
330
330
|
# Backward compatiblity: translate 'team' to 'scrum_team'
|
331
331
|
scrum_team = issue_data['scrum_team'] || issue_data['team']
|
332
|
+
|
332
333
|
if scrum_team
|
333
|
-
|
334
|
-
|
335
|
-
else
|
336
|
-
jira_fields['customfield_11500'] = { FIELD_VALUE => scrum_team }
|
337
|
-
end
|
334
|
+
field_name, field_value = scrum_team_rules(issue_data, scrum_team)
|
335
|
+
jira_fields[field_name] = field_value
|
338
336
|
end
|
339
337
|
|
340
|
-
#
|
341
|
-
# issues take only the first of the list
|
338
|
+
# Backward compatiblity: translate 'teams' to 'scrum_teams'
|
342
339
|
scrum_teams = issue_data['scrum_teams'] || issue_data['teams']
|
340
|
+
|
343
341
|
if scrum_teams
|
344
|
-
|
345
|
-
|
346
|
-
jira_fields['components'] = processed_teams.map { |team| { FIELD_NAME => team } }
|
347
|
-
else
|
348
|
-
jira_fields['customfield_11500'] = { FIELD_VALUE => processed_teams.first }
|
349
|
-
end
|
342
|
+
field_name, field_value = scrum_teams_rules(issue_data, scrum_team)
|
343
|
+
jira_fields[field_name] = field_value
|
350
344
|
end
|
351
345
|
|
352
346
|
# Default issue type to ISSUE_TASK if it isn't already set
|
@@ -368,6 +362,36 @@ module Tefoji
|
|
368
362
|
end
|
369
363
|
end
|
370
364
|
|
365
|
+
# There are now some funky rules for setting the 'scrum_team' (previously 'team')
|
366
|
+
# and 'scrum_teams' field in different issues.
|
367
|
+
#
|
368
|
+
# For epics, put the scrum team in the 'components' field.
|
369
|
+
# Except for a couple of projects, put the scrum team in customfield_11500
|
370
|
+
# For Puppet Agent (PA) and Puppet Server (SERVER) projects, put the scrum team in
|
371
|
+
# customfield_14200
|
372
|
+
def scrum_team_rules(issue_data, scrum_team)
|
373
|
+
if epic?(issue_data)
|
374
|
+
return ['components', [{ FIELD_NAME => scrum_team }]]
|
375
|
+
end
|
376
|
+
|
377
|
+
customfield = 'customfield_11500'
|
378
|
+
if %w[PA SERVER].include?(issue_data['project'].value)
|
379
|
+
customfield = 'customfield_14200'
|
380
|
+
end
|
381
|
+
|
382
|
+
return [customfield, { FIELD_VALUE => scrum_team }]
|
383
|
+
end
|
384
|
+
|
385
|
+
def scrum_teams_rules(issue_data, scrum_teams)
|
386
|
+
processed_teams = scrum_teams.to_a.flatten.reject { |t| t =~ /^\s*$/ }
|
387
|
+
if epic?(issue_data)
|
388
|
+
return ['components', processed_teams.map { |team| { FIELD_NAME => team } }]
|
389
|
+
end
|
390
|
+
|
391
|
+
# For ordinary issues we can only set one team.
|
392
|
+
scrum_team_rules(issue_data, processed_teams.first)
|
393
|
+
end
|
394
|
+
|
371
395
|
def set_cloud_jira_fields(issue_data, jira_fields)
|
372
396
|
if issue_data['assignee']
|
373
397
|
assignee = issue_data['assignee']
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tefoji
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Puppet Labs
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-07-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: pry-byebug
|