exe/jira-stories-deployed in pivotoolz-2.2.0 vs exe/jira-stories-deployed in pivotoolz-2.3.0
- old
+ new
@@ -1,9 +1,10 @@
#!/usr/bin/env ruby
require 'json'
require 'ostruct'
+require 'uri'
BASE_URL = ENV['JIRA_API_BASE_URL']
if BASE_URL.nil? || BASE_URL.empty?
puts "Please set JIRA_API_BASE_URL. It looks something like 'https://YOUR-COMPANY.atlassian.net/rest/api/2/issue/'"
@@ -61,14 +62,16 @@
json.to_json
end
def story_owner_names(story, flags)
- owners = story
- .owners
- .compact
- .map { |o| OpenStruct.new(o).name }
+ owners = *(
+ story
+ .fields
+ .assignee
+ &.displayName
+ )
if flags.include? '--bold-owners'
return to_sentence(owners.map { |o| "*#{o}*" })
end
@@ -83,10 +86,10 @@
stories_deployed = deployed_story_infos
.split("\n")
.compact
.reduce([]) do |reduced, story_info|
- story = OpenStruct.new(JSON.parse(story_info))
+ story = JSON.parse(story_info, object_class: OpenStruct)
if format_as_json
reduced << as_json(story, include_owners, flags, subdomain)
next reduced
end