You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#!/usr/bin/env ruby
require 'json'if ENV['PT_TOKEN'].nil?
puts <<~PT_TOKEN_NOT_PROVIDED ERROR: PT_TOKEN env variable not set, exiting... Please go to your profile page: https://www.pivotaltracker.com/profile You should see the API token near the bottom set up an environment variable called PT_TOKEN with your API key as the value, i.e. export PT_TOKEN=myt0k3nh3r3 even better, use something like .evnrc + direnv PT_TOKEN_NOT_PROVIDEDendif ARGV[0].nil? puts <<~ID_NOT_PROVIDED ERROR: ticket ID not provided, exiting... Please proveide a ticket ID, ie something like bin/story 12345 # or whatever the ticket number is ID_NOT_PROVIDED exitendticket_id = ARGV[0]. gsub('#','')puts "Grabbing ticket ID #{ticket_id}"`curl -X GET -H "X-TrackerToken: $PT_TOKEN""https://www.pivotaltracker.com/services/v5/stories/#{ARGV[0]}"` .then { |raw_response| JSON.parse(raw_response) } .then { |json_response| fail "ERROR: #{json_response}" if json_response["error"]; json_response } .then { |json_response| branch_name, ticket_id = json_response.values_at("id", "name") } .then { |ticket_data| ticket_data.join(' ') } .then { |ticket_string_spaces| ticket_string_spaces.tr(' ', '-').chomp('.') } #TODO - where's . coming from? >.< .then { |branch_name| puts "creating new branch: >>#{branch_name}<<"; branch_name } .then { |branch_name| `git checkout -b #{branch_name}` }
The text was updated successfully, but these errors were encountered:
Something like this script for Pivotal Tracker:
The text was updated successfully, but these errors were encountered: