{"action":"created","comment":{"url":"https://api.github.com/repos/fastlane/fastlane/pulls/comments/65401485","id":65401485,"diff_hunk":"@@ -0,0 +1,116 @@\n+module Fastlane\n+  module Actions\n+    class JiraTransitionAction < Action\n+\n+      def self.run(params)\n+        Actions.verify_gem!('jira-ruby')\n+        require 'jira'\n+\n+        site          = params[:url]\n+        context_path  = \"\"\n+        auth_type     = :basic\n+        username      = params[:username]\n+        password      = params[:password]\n+        project_key   = params[:project_key]\n+        transition_id = params[:transition_id]\n+        comment_text  = params[:comment]\n+\n+        options = {\n+                    site: site,\n+                    context_path: context_path,\n+                    auth_type: auth_type,\n+                    username: username,\n+                    password: password\n+                  }\n+\n+        client = JIRA::Client.new(options)\n+\n+        if Actions.lane_context[SharedValues::FL_CHANGELOG].nil?\n+          changelog_configuration = FastlaneCore::Configuration.create(Actions::ChangelogFromGitCommitsAction.available_options, {})\n+          Actions::ChangelogFromGitCommitsAction.run(changelog_configuration)\n+        end\n+\n+        issue_ids = Actions.lane_context[SharedValues::FL_CHANGELOG].scan(/#{project_key}-\\d+/i).uniq\n+\n+        issue_ids.each do |issue_id|\n+          begin\n+            issue = client.Issue.find(issue_id)\n+            transition = issue.transitions.build\n+            transition.save!(\"transition\" => { \"id\" => transition_id })\n+\n+            if !comment_text.nil?","path":"fastlane/lib/fastlane/actions/jira_transition.rb","position":41,"original_position":41,"commit_id":"70f3bbe4f9c261879bbf00f83c163376633f3c1f","original_commit_id":"70f3bbe4f9c261879bbf00f83c163376633f3c1f","user":{"login":"houndci-bot","id":6697940,"avatar_url":"https://avatars.githubusercontent.com/u/6697940?v=3","gravatar_id":"","url":"https://api.github.com/users/houndci-bot","html_url":"https://github.com/houndci-bot","followers_url":"https://api.github.com/users/houndci-bot/followers","following_url":"https://api.github.com/users/houndci-bot/following{/other_user}","gists_url":"https://api.github.com/users/houndci-bot/gists{/gist_id}","starred_url":"https://api.github.com/users/houndci-bot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/houndci-bot/subscriptions","organizations_url":"https://api.github.com/users/houndci-bot/orgs","repos_url":"https://api.github.com/users/houndci-bot/repos","events_url":"https://api.github.com/users/houndci-bot/events{/privacy}","received_events_url":"https://api.github.com/users/houndci-bot/received_events","type":"User","site_admin":false},"body":"Favor `unless` over `if` for negative conditions.","created_at":"2016-06-01T17:02:51Z","updated_at":"2016-06-01T17:02:51Z","html_url":"https://github.com/fastlane/fastlane/pull/4940#discussion_r65401485","pull_request_url":"https://api.github.com/repos/fastlane/fastlane/pulls/4940","_links":{"self":{"href":"https://api.github.com/repos/fastlane/fastlane/pulls/comments/65401485"},"html":{"href":"https://github.com/fastlane/fastlane/pull/4940#discussion_r65401485"},"pull_request":{"href":"https://api.github.com/repos/fastlane/fastlane/pulls/4940"}}},"pull_request":{"url":"https://api.github.com/repos/fastlane/fastlane/pulls/4940","id":72216910,"html_url":"https://github.com/fastlane/fastlane/pull/4940","diff_url":"https://github.com/fastlane/fastlane/pull/4940.diff","patch_url":"https://github.com/fastlane/fastlane/pull/4940.patch","issue_url":"https://api.github.com/repos/fastlane/fastlane/issues/4940","number":4940,"state":"open","locked":false,"title":"JIRA Transition Action","user":{"login":"valeriomazzeo","id":1882080,"avatar_url":"https://avatars.githubusercontent.com/u/1882080?v=3","gravatar_id":"","url":"https://api.github.com/users/valeriomazzeo","html_url":"https://github.com/valeriomazzeo","followers_url":"https://api.github.com/users/valeriomazzeo/followers","following_url":"https://api.github.com/users/valeriomazzeo/following{/other_user}","gists_url":"https://api.github.com/users/valeriomazzeo/gists{/gist_id}","starred_url":"https://api.github.com/users/valeriomazzeo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/valeriomazzeo/subscriptions","organizations_url":"https://api.github.com/users/valeriomazzeo/orgs","repos_url":"https://api.github.com/users/valeriomazzeo/repos","events_url":"https://api.github.com/users/valeriomazzeo/events{/privacy}","received_events_url":"https://api.github.com/users/valeriomazzeo/received_events","type":"User","site_admin":false},"body":"Implemented custom action to automate JIRA issues transitions based on issue ids found in the changelog.\r\n\r\nThis is particularly useful when running fastlane on a CI, for example when deploying to HockeyApp / Crashlytics, to move all the deployed issues to another state (for example: Ready For Testing).","created_at":"2016-06-01T17:02:48Z","updated_at":"2016-06-01T17:02:51Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5d52774338f2597f04ed8e765e8676c6f0584b04","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/fastlane/fastlane/pulls/4940/commits","review_comments_url":"https://api.github.com/repos/fastlane/fastlane/pulls/4940/comments","review_comment_url":"https://api.github.com/repos/fastlane/fastlane/pulls/comments{/number}","comments_url":"https://api.github.com/repos/fastlane/fastlane/issues/4940/comments","statuses_url":"https://api.github.com/repos/fastlane/fastlane/statuses/70f3bbe4f9c261879bbf00f83c163376633f3c1f","head":{"label":"valeriomazzeo:feature/jira-transition","ref":"feature/jira-transition","sha":"70f3bbe4f9c261879bbf00f83c163376633f3c1f","user":{"login":"valeriomazzeo","id":1882080,"avatar_url":"https://avatars.githubusercontent.com/u/1882080?v=3","gravatar_id":"","url":"https://api.github.com/users/valeriomazzeo","html_url":"https://github.com/valeriomazzeo","followers_url":"https://api.github.com/users/valeriomazzeo/followers","following_url":"https://api.github.com/users/valeriomazzeo/following{/other_user}","gists_url":"https://api.github.com/users/valeriomazzeo/gists{/gist_id}","starred_url":"https://api.github.com/users/valeriomazzeo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/valeriomazzeo/subscriptions","organizations_url":"https://api.github.com/users/valeriomazzeo/orgs","repos_url":"https://api.github.com/users/valeriomazzeo/repos","events_url":"https://api.github.com/users/valeriomazzeo/events{/privacy}","received_events_url":"https://api.github.com/users/valeriomazzeo/received_events","type":"User","site_admin":false},"repo":{"id":60168832,"name":"fastlane","full_name":"valeriomazzeo/fastlane","owner":{"login":"valeriomazzeo","id":1882080,"avatar_url":"https://avatars.githubusercontent.com/u/1882080?v=3","gravatar_id":"","url":"https://api.github.com/users/valeriomazzeo","html_url":"https://github.com/valeriomazzeo","followers_url":"https://api.github.com/users/valeriomazzeo/followers","following_url":"https://api.github.com/users/valeriomazzeo/following{/other_user}","gists_url":"https://api.github.com/users/valeriomazzeo/gists{/gist_id}","starred_url":"https://api.github.com/users/valeriomazzeo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/valeriomazzeo/subscriptions","organizations_url":"https://api.github.com/users/valeriomazzeo/orgs","repos_url":"https://api.github.com/users/valeriomazzeo/repos","events_url":"https://api.github.com/users/valeriomazzeo/events{/privacy}","received_events_url":"https://api.github.com/users/valeriomazzeo/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/valeriomazzeo/fastlane","description":"The easiest way to automate building and releasing your iOS and Android apps","fork":true,"url":"https://api.github.com/repos/valeriomazzeo/fastlane","forks_url":"https://api.github.com/repos/valeriomazzeo/fastlane/forks","keys_url":"https://api.github.com/repos/valeriomazzeo/fastlane/keys{/key_id}","collaborators_url":"https://api.github.com/repos/valeriomazzeo/fastlane/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/valeriomazzeo/fastlane/teams","hooks_url":"https://api.github.com/repos/valeriomazzeo/fastlane/hooks","issue_events_url":"https://api.github.com/repos/valeriomazzeo/fastlane/issues/events{/number}","events_url":"https://api.github.com/repos/valeriomazzeo/fastlane/events","assignees_url":"https://api.github.com/repos/valeriomazzeo/fastlane/assignees{/user}","branches_url":"https://api.github.com/repos/valeriomazzeo/fastlane/branches{/branch}","tags_url":"https://api.github.com/repos/valeriomazzeo/fastlane/tags","blobs_url":"https://api.github.com/repos/valeriomazzeo/fastlane/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/valeriomazzeo/fastlane/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/valeriomazzeo/fastlane/git/refs{/sha}","trees_url":"https://api.github.com/repos/valeriomazzeo/fastlane/git/trees{/sha}","statuses_url":"https://api.github.com/repos/valeriomazzeo/fastlane/statuses/{sha}","languages_url":"https://api.github.com/repos/valeriomazzeo/fastlane/languages","stargazers_url":"https://api.github.com/repos/valeriomazzeo/fastlane/stargazers","contributors_url":"https://api.github.com/repos/valeriomazzeo/fastlane/contributors","subscribers_url":"https://api.github.com/repos/valeriomazzeo/fastlane/subscribers","subscription_url":"https://api.github.com/repos/valeriomazzeo/fastlane/subscription","commits_url":"https://api.github.com/repos/valeriomazzeo/fastlane/commits{/sha}","git_commits_url":"https://api.github.com/repos/valeriomazzeo/fastlane/git/commits{/sha}","comments_url":"https://api.github.com/repos/valeriomazzeo/fastlane/comments{/number}","issue_comment_url":"https://api.github.com/repos/valeriomazzeo/fastlane/issues/comments{/number}","contents_url":"https://api.github.com/repos/valeriomazzeo/fastlane/contents/{+path}","compare_url":"https://api.github.com/repos/valeriomazzeo/fastlane/compare/{base}...{head}","merges_url":"https://api.github.com/repos/valeriomazzeo/fastlane/merges","archive_url":"https://api.github.com/repos/valeriomazzeo/fastlane/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/valeriomazzeo/fastlane/downloads","issues_url":"https://api.github.com/repos/valeriomazzeo/fastlane/issues{/number}","pulls_url":"https://api.github.com/repos/valeriomazzeo/fastlane/pulls{/number}","milestones_url":"https://api.github.com/repos/valeriomazzeo/fastlane/milestones{/number}","notifications_url":"https://api.github.com/repos/valeriomazzeo/fastlane/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/valeriomazzeo/fastlane/labels{/name}","releases_url":"https://api.github.com/repos/valeriomazzeo/fastlane/releases{/id}","deployments_url":"https://api.github.com/repos/valeriomazzeo/fastlane/deployments","created_at":"2016-06-01T10:47:07Z","updated_at":"2016-06-01T10:47:12Z","pushed_at":"2016-06-01T17:00:31Z","git_url":"git://github.com/valeriomazzeo/fastlane.git","ssh_url":"git@github.com:valeriomazzeo/fastlane.git","clone_url":"https://github.com/valeriomazzeo/fastlane.git","svn_url":"https://github.com/valeriomazzeo/fastlane","homepage":"https://fastlane.tools","size":50481,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"fastlane:master","ref":"master","sha":"27126d331a2c769d25b22d30ce8881b8a185a81f","user":{"login":"fastlane","id":11098337,"avatar_url":"https://avatars.githubusercontent.com/u/11098337?v=3","gravatar_id":"","url":"https://api.github.com/users/fastlane","html_url":"https://github.com/fastlane","followers_url":"https://api.github.com/users/fastlane/followers","following_url":"https://api.github.com/users/fastlane/following{/other_user}","gists_url":"https://api.github.com/users/fastlane/gists{/gist_id}","starred_url":"https://api.github.com/users/fastlane/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fastlane/subscriptions","organizations_url":"https://api.github.com/users/fastlane/orgs","repos_url":"https://api.github.com/users/fastlane/repos","events_url":"https://api.github.com/users/fastlane/events{/privacy}","received_events_url":"https://api.github.com/users/fastlane/received_events","type":"Organization","site_admin":false},"repo":{"id":27442967,"name":"fastlane","full_name":"fastlane/fastlane","owner":{"login":"fastlane","id":11098337,"avatar_url":"https://avatars.githubusercontent.com/u/11098337?v=3","gravatar_id":"","url":"https://api.github.com/users/fastlane","html_url":"https://github.com/fastlane","followers_url":"https://api.github.com/users/fastlane/followers","following_url":"https://api.github.com/users/fastlane/following{/other_user}","gists_url":"https://api.github.com/users/fastlane/gists{/gist_id}","starred_url":"https://api.github.com/users/fastlane/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fastlane/subscriptions","organizations_url":"https://api.github.com/users/fastlane/orgs","repos_url":"https://api.github.com/users/fastlane/repos","events_url":"https://api.github.com/users/fastlane/events{/privacy}","received_events_url":"https://api.github.com/users/fastlane/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/fastlane/fastlane","description":"The easiest way to automate building and releasing your iOS and Android apps","fork":false,"url":"https://api.github.com/repos/fastlane/fastlane","forks_url":"https://api.github.com/repos/fastlane/fastlane/forks","keys_url":"https://api.github.com/repos/fastlane/fastlane/keys{/key_id}","collaborators_url":"https://api.github.com/repos/fastlane/fastlane/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/fastlane/fastlane/teams","hooks_url":"https://api.github.com/repos/fastlane/fastlane/hooks","issue_events_url":"https://api.github.com/repos/fastlane/fastlane/issues/events{/number}","events_url":"https://api.github.com/repos/fastlane/fastlane/events","assignees_url":"https://api.github.com/repos/fastlane/fastlane/assignees{/user}","branches_url":"https://api.github.com/repos/fastlane/fastlane/branches{/branch}","tags_url":"https://api.github.com/repos/fastlane/fastlane/tags","blobs_url":"https://api.github.com/repos/fastlane/fastlane/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/fastlane/fastlane/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/fastlane/fastlane/git/refs{/sha}","trees_url":"https://api.github.com/repos/fastlane/fastlane/git/trees{/sha}","statuses_url":"https://api.github.com/repos/fastlane/fastlane/statuses/{sha}","languages_url":"https://api.github.com/repos/fastlane/fastlane/languages","stargazers_url":"https://api.github.com/repos/fastlane/fastlane/stargazers","contributors_url":"https://api.github.com/repos/fastlane/fastlane/contributors","subscribers_url":"https://api.github.com/repos/fastlane/fastlane/subscribers","subscription_url":"https://api.github.com/repos/fastlane/fastlane/subscription","commits_url":"https://api.github.com/repos/fastlane/fastlane/commits{/sha}","git_commits_url":"https://api.github.com/repos/fastlane/fastlane/git/commits{/sha}","comments_url":"https://api.github.com/repos/fastlane/fastlane/comments{/number}","issue_comment_url":"https://api.github.com/repos/fastlane/fastlane/issues/comments{/number}","contents_url":"https://api.github.com/repos/fastlane/fastlane/contents/{+path}","compare_url":"https://api.github.com/repos/fastlane/fastlane/compare/{base}...{head}","merges_url":"https://api.github.com/repos/fastlane/fastlane/merges","archive_url":"https://api.github.com/repos/fastlane/fastlane/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/fastlane/fastlane/downloads","issues_url":"https://api.github.com/repos/fastlane/fastlane/issues{/number}","pulls_url":"https://api.github.com/repos/fastlane/fastlane/pulls{/number}","milestones_url":"https://api.github.com/repos/fastlane/fastlane/milestones{/number}","notifications_url":"https://api.github.com/repos/fastlane/fastlane/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/fastlane/fastlane/labels{/name}","releases_url":"https://api.github.com/repos/fastlane/fastlane/releases{/id}","deployments_url":"https://api.github.com/repos/fastlane/fastlane/deployments","created_at":"2014-12-02T17:00:38Z","updated_at":"2016-06-01T16:57:34Z","pushed_at":"2016-06-01T17:02:49Z","git_url":"git://github.com/fastlane/fastlane.git","ssh_url":"git@github.com:fastlane/fastlane.git","clone_url":"https://github.com/fastlane/fastlane.git","svn_url":"https://github.com/fastlane/fastlane","homepage":"https://fastlane.tools","size":59000,"stargazers_count":8287,"watchers_count":8287,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1117,"mirror_url":null,"open_issues_count":736,"forks":1117,"open_issues":736,"watchers":8287,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/fastlane/fastlane/pulls/4940"},"html":{"href":"https://github.com/fastlane/fastlane/pull/4940"},"issue":{"href":"https://api.github.com/repos/fastlane/fastlane/issues/4940"},"comments":{"href":"https://api.github.com/repos/fastlane/fastlane/issues/4940/comments"},"review_comments":{"href":"https://api.github.com/repos/fastlane/fastlane/pulls/4940/comments"},"review_comment":{"href":"https://api.github.com/repos/fastlane/fastlane/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/fastlane/fastlane/pulls/4940/commits"},"statuses":{"href":"https://api.github.com/repos/fastlane/fastlane/statuses/70f3bbe4f9c261879bbf00f83c163376633f3c1f"}}}}
{"actor":{"display_login":"houndci-bot"}}