createissue_jira 0.1.8 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.idea/.gitignore +8 -0
- data/.idea/createissue_jira.iml +65 -0
- data/.idea/misc.xml +4 -0
- data/.idea/modules.xml +8 -0
- data/.idea/vcs.xml +6 -0
- data/Gemfile.lock +51 -0
- data/README.md +1 -1
- data/createissue_jira-0.1.0.gem +0 -0
- data/createissue_jira-0.1.1.gem +0 -0
- data/createissue_jira-0.1.5.gem +0 -0
- data/createissue_jira-0.1.6.gem +0 -0
- data/createissue_jira-0.1.7.gem +0 -0
- data/createissue_jira-0.1.8.gem +0 -0
- data/createissue_jira.gemspec +44 -0
- data/lib/createissue_jira/version.rb +1 -1
- data/lib/createissue_jira.rb +48 -46
- metadata +23 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8ddd1e79a3d28d6bf5e20cf3e9717d4c016017992d02060e474db6555568c54c
|
4
|
+
data.tar.gz: 1a739441f44a43cbe88be50dc6e569e16ab1f49ed607ee4eabeb75aebf96393e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4ac7fafe471865de2b2c2338834f3b046ae47884a6b8a607f77cf49bf8ab179aaa8eec47c139dd46636e21e8bcaa4cb874cf32dc9f61f033c8c2884cc0c8fbc7
|
7
|
+
data.tar.gz: 38c98832b2570f6e40e44692f4902e2f9c46ef4111887158280fd9f1ba76fa58df4f7afc887129793879ac56a7a2a09f5d6d769ea7f886c21a4d35b7452ba382
|
data/.idea/.gitignore
ADDED
@@ -0,0 +1,65 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<module type="RUBY_MODULE" version="4">
|
3
|
+
<component name="ModuleRunConfigurationManager">
|
4
|
+
<shared />
|
5
|
+
</component>
|
6
|
+
<component name="NewModuleRootManager">
|
7
|
+
<content url="file://$MODULE_DIR$">
|
8
|
+
<sourceFolder url="file://$MODULE_DIR$/features" isTestSource="true" />
|
9
|
+
<sourceFolder url="file://$MODULE_DIR$/spec" isTestSource="true" />
|
10
|
+
<sourceFolder url="file://$MODULE_DIR$/test" isTestSource="true" />
|
11
|
+
</content>
|
12
|
+
<orderEntry type="jdk" jdkName="ruby-2.7.4-p191" jdkType="RUBY_SDK" />
|
13
|
+
<orderEntry type="sourceFolder" forTests="false" />
|
14
|
+
<orderEntry type="library" scope="PROVIDED" name="base64 (v0.1.1, ruby-2.7.4-p191) [gem]" level="application" />
|
15
|
+
<orderEntry type="library" scope="PROVIDED" name="bundler (v2.4.1, ruby-2.7.4-p191) [gem]" level="application" />
|
16
|
+
<orderEntry type="library" scope="PROVIDED" name="domain_name (v0.5.20190701, ruby-2.7.4-p191) [gem]" level="application" />
|
17
|
+
<orderEntry type="library" scope="PROVIDED" name="ffi (v1.15.5, ruby-2.7.4-p191) [gem]" level="application" />
|
18
|
+
<orderEntry type="library" scope="PROVIDED" name="http-accept (v1.7.0, ruby-2.7.4-p191) [gem]" level="application" />
|
19
|
+
<orderEntry type="library" scope="PROVIDED" name="http-cookie (v1.0.5, ruby-2.7.4-p191) [gem]" level="application" />
|
20
|
+
<orderEntry type="library" scope="PROVIDED" name="json (v2.6.3, ruby-2.7.4-p191) [gem]" level="application" />
|
21
|
+
<orderEntry type="library" scope="PROVIDED" name="mime-types (v3.4.1, ruby-2.7.4-p191) [gem]" level="application" />
|
22
|
+
<orderEntry type="library" scope="PROVIDED" name="mime-types-data (v3.2022.0105, ruby-2.7.4-p191) [gem]" level="application" />
|
23
|
+
<orderEntry type="library" scope="PROVIDED" name="netrc (v0.11.0, ruby-2.7.4-p191) [gem]" level="application" />
|
24
|
+
<orderEntry type="library" scope="PROVIDED" name="nokogiri (v1.13.10, ruby-2.7.4-p191) [gem]" level="application" />
|
25
|
+
<orderEntry type="library" scope="PROVIDED" name="racc (v1.6.2, ruby-2.7.4-p191) [gem]" level="application" />
|
26
|
+
<orderEntry type="library" scope="PROVIDED" name="rake (v13.0.6, ruby-2.7.4-p191) [gem]" level="application" />
|
27
|
+
<orderEntry type="library" scope="PROVIDED" name="rest-client (v2.1.0, ruby-2.7.4-p191) [gem]" level="application" />
|
28
|
+
<orderEntry type="library" scope="PROVIDED" name="roo (v2.9.0, ruby-2.7.4-p191) [gem]" level="application" />
|
29
|
+
<orderEntry type="library" scope="PROVIDED" name="rubyzip (v2.3.2, ruby-2.7.4-p191) [gem]" level="application" />
|
30
|
+
<orderEntry type="library" scope="PROVIDED" name="unf (v0.1.4, ruby-2.7.4-p191) [gem]" level="application" />
|
31
|
+
<orderEntry type="library" scope="PROVIDED" name="unf_ext (v0.0.8.2, ruby-2.7.4-p191) [gem]" level="application" />
|
32
|
+
</component>
|
33
|
+
<component name="RakeTasksCache">
|
34
|
+
<option name="myRootTask">
|
35
|
+
<RakeTaskImpl id="rake">
|
36
|
+
<subtasks>
|
37
|
+
<RakeTaskImpl description="Build createissue_jira-0.1.8.gem into the pkg directory" fullCommand="build" id="build" />
|
38
|
+
<RakeTaskImpl id="build">
|
39
|
+
<subtasks>
|
40
|
+
<RakeTaskImpl description="Generate SHA512 checksum if createissue_jira-0.1.8.gem into the checksums directory" fullCommand="build:checksum" id="checksum" />
|
41
|
+
</subtasks>
|
42
|
+
</RakeTaskImpl>
|
43
|
+
<RakeTaskImpl description="Remove any temporary products" fullCommand="clean" id="clean" />
|
44
|
+
<RakeTaskImpl description="Remove any generated files" fullCommand="clobber" id="clobber" />
|
45
|
+
<RakeTaskImpl description="Build and install createissue_jira-0.1.8.gem into system gems" fullCommand="install" id="install" />
|
46
|
+
<RakeTaskImpl id="install">
|
47
|
+
<subtasks>
|
48
|
+
<RakeTaskImpl description="Build and install createissue_jira-0.1.8.gem into system gems without network access" fullCommand="install:local" id="local" />
|
49
|
+
</subtasks>
|
50
|
+
</RakeTaskImpl>
|
51
|
+
<RakeTaskImpl description="Create tag v0.1.8 and build and push createissue_jira-0.1.8.gem to https://rubygems.org" fullCommand="release[remote]" id="release[remote]" />
|
52
|
+
<RakeTaskImpl description="" fullCommand="default" id="default" />
|
53
|
+
<RakeTaskImpl description="" fullCommand="release" id="release" />
|
54
|
+
<RakeTaskImpl id="release">
|
55
|
+
<subtasks>
|
56
|
+
<RakeTaskImpl description="" fullCommand="release:guard_clean" id="guard_clean" />
|
57
|
+
<RakeTaskImpl description="" fullCommand="release:rubygem_push" id="rubygem_push" />
|
58
|
+
<RakeTaskImpl description="" fullCommand="release:source_control_push" id="source_control_push" />
|
59
|
+
</subtasks>
|
60
|
+
</RakeTaskImpl>
|
61
|
+
</subtasks>
|
62
|
+
</RakeTaskImpl>
|
63
|
+
</option>
|
64
|
+
</component>
|
65
|
+
</module>
|
data/.idea/misc.xml
ADDED
data/.idea/modules.xml
ADDED
@@ -0,0 +1,8 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<project version="4">
|
3
|
+
<component name="ProjectModuleManager">
|
4
|
+
<modules>
|
5
|
+
<module fileurl="file://$PROJECT_DIR$/.idea/createissue_jira.iml" filepath="$PROJECT_DIR$/.idea/createissue_jira.iml" />
|
6
|
+
</modules>
|
7
|
+
</component>
|
8
|
+
</project>
|
data/.idea/vcs.xml
ADDED
data/Gemfile.lock
ADDED
@@ -0,0 +1,51 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
createissue_jira (0.1.9)
|
5
|
+
base64 (~> 0.1, >= 0.1.0)
|
6
|
+
json (~> 2.1, >= 2.1.0)
|
7
|
+
rest-client (~> 2.0, >= 2.0.2)
|
8
|
+
roo (~> 2.8, >= 2.8.3)
|
9
|
+
|
10
|
+
GEM
|
11
|
+
remote: https://rubygems.org/
|
12
|
+
specs:
|
13
|
+
base64 (0.1.1)
|
14
|
+
domain_name (0.5.20190701)
|
15
|
+
unf (>= 0.0.5, < 1.0.0)
|
16
|
+
ffi (1.15.5-x64-mingw32)
|
17
|
+
http-accept (1.7.0)
|
18
|
+
http-cookie (1.0.5)
|
19
|
+
domain_name (~> 0.5)
|
20
|
+
json (2.6.3)
|
21
|
+
mime-types (3.4.1)
|
22
|
+
mime-types-data (~> 3.2015)
|
23
|
+
mime-types-data (3.2022.0105)
|
24
|
+
netrc (0.11.0)
|
25
|
+
nokogiri (1.13.10-x64-mingw32)
|
26
|
+
racc (~> 1.4)
|
27
|
+
racc (1.6.2)
|
28
|
+
rake (13.0.6)
|
29
|
+
rest-client (2.1.0-x64-mingw32)
|
30
|
+
ffi (~> 1.9)
|
31
|
+
http-accept (>= 1.7.0, < 2.0)
|
32
|
+
http-cookie (>= 1.0.2, < 2.0)
|
33
|
+
mime-types (>= 1.16, < 4.0)
|
34
|
+
netrc (~> 0.8)
|
35
|
+
roo (2.9.0)
|
36
|
+
nokogiri (~> 1)
|
37
|
+
rubyzip (>= 1.3.0, < 3.0.0)
|
38
|
+
rubyzip (2.3.2)
|
39
|
+
unf (0.1.4)
|
40
|
+
unf_ext
|
41
|
+
unf_ext (0.0.8.2-x64-mingw32)
|
42
|
+
|
43
|
+
PLATFORMS
|
44
|
+
x64-mingw32
|
45
|
+
|
46
|
+
DEPENDENCIES
|
47
|
+
createissue_jira!
|
48
|
+
rake (~> 13.0)
|
49
|
+
|
50
|
+
BUNDLED WITH
|
51
|
+
2.4.1
|
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# CreateissueJira
|
2
2
|
|
3
|
-
Welcome to
|
3
|
+
Welcome to new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/createissue_jira`. To experiment with that code, run `bin/console` for an interactive prompt.
|
4
4
|
|
5
5
|
TODO: Delete this and the text above, and describe your gem
|
6
6
|
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
@@ -0,0 +1,44 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "lib/createissue_jira/version"
|
4
|
+
|
5
|
+
Gem::Specification.new do |spec|
|
6
|
+
spec.name = "createissue_jira"
|
7
|
+
spec.version = CreateissueJira::VERSION
|
8
|
+
spec.authors = ["SachinPatel"]
|
9
|
+
spec.email = ["sachinpatel8890@outlook.com"]
|
10
|
+
|
11
|
+
spec.summary = "This gem can be use to create a jira ticket specifically for the QA test case under Jira Epic"
|
12
|
+
spec.description = "Write a longer description or delete this line."
|
13
|
+
spec.homepage = "https://github.com/Sachin8890/createissue_jira"
|
14
|
+
spec.license = "MIT"
|
15
|
+
spec.required_ruby_version = ">= 2.5.0"
|
16
|
+
|
17
|
+
spec.metadata["allowed_push_host"] = "https://rubygems.org"
|
18
|
+
|
19
|
+
spec.metadata["homepage_uri"] = spec.homepage
|
20
|
+
spec.metadata["source_code_uri"] = "https://github.com/Sachin8890/createissue_jira"
|
21
|
+
spec.metadata["changelog_uri"] = "https://rubygems.org"
|
22
|
+
|
23
|
+
# Specify which files should be added to the gem when it is released.
|
24
|
+
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
25
|
+
spec.files = Dir.chdir(__dir__) do
|
26
|
+
`git ls-files -z`.split("\x0").reject do |f|
|
27
|
+
(f == __FILE__) || f.match(%r{\A(?:(?:bin|test|spec|features)/|\.(?:git|travis|circleci)|appveyor)})
|
28
|
+
end
|
29
|
+
end
|
30
|
+
spec.bindir = "exe"
|
31
|
+
spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
|
32
|
+
spec.require_paths = ["lib"]
|
33
|
+
|
34
|
+
# Uncomment to register a new dependency of your gem
|
35
|
+
# spec.add_dependency "example-gem", "~> 1.0"
|
36
|
+
spec.add_runtime_dependency 'rest-client', '~> 2.0', '>=2.0.2'
|
37
|
+
spec.add_runtime_dependency 'json', '~> 2.1', '>=2.1.0'
|
38
|
+
spec.add_runtime_dependency 'roo', '~> 2.8', '>=2.8.3'
|
39
|
+
spec.add_runtime_dependency 'base64', '~> 0.1', '>=0.1.0'
|
40
|
+
|
41
|
+
|
42
|
+
# For more information and examples about making a new gem, check out our
|
43
|
+
# guide at: https://bundler.io/guides/creating_gem.html
|
44
|
+
end
|
data/lib/createissue_jira.rb
CHANGED
@@ -8,11 +8,12 @@ require 'roo'
|
|
8
8
|
|
9
9
|
module CreateissueJira
|
10
10
|
class Datafile
|
11
|
-
def jira_api_credentials base_url, jira_api_token, assignee_id, acceptance_criteria_id
|
11
|
+
def jira_api_credentials email,base_url, jira_api_token, assignee_id, acceptance_criteria_id
|
12
12
|
@base_url = base_url
|
13
13
|
@jira_api_token = jira_api_token
|
14
14
|
@assignee_id = assignee_id
|
15
15
|
@acceptance_criteria_id = acceptance_criteria_id
|
16
|
+
@email = email
|
16
17
|
end
|
17
18
|
|
18
19
|
def load_file (file_path, sheet_no, header_name)
|
@@ -60,72 +61,73 @@ module CreateissueJira
|
|
60
61
|
i = 0
|
61
62
|
@summary.size.times do
|
62
63
|
payload = {
|
63
|
-
|
64
|
+
"fields":
|
65
|
+
{
|
66
|
+
"project":
|
67
|
+
{
|
68
|
+
"key": project_key
|
69
|
+
},
|
70
|
+
"parent":
|
71
|
+
{
|
72
|
+
"key": epic_key
|
73
|
+
},
|
74
|
+
"summary": @summary[i],
|
75
|
+
"description": @description[i],
|
76
|
+
|
77
|
+
"issuetype":
|
64
78
|
{
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
},
|
73
|
-
"summary": @summary[i],
|
74
|
-
"description": @description[i],
|
75
|
-
|
76
|
-
"issuetype":
|
77
|
-
{
|
78
|
-
"name": "Story"
|
79
|
-
},
|
80
|
-
"#{@acceptance_criteria_id}": @business_acceptance[i],
|
81
|
-
"labels": [
|
82
|
-
label
|
83
|
-
]
|
84
|
-
}
|
79
|
+
"name": "Story"
|
80
|
+
},
|
81
|
+
"#{@acceptance_criteria_id}": @business_acceptance[i],
|
82
|
+
"labels": [
|
83
|
+
label
|
84
|
+
]
|
85
|
+
}
|
85
86
|
}
|
86
87
|
|
88
|
+
#2022 - atlassian - jira password updated with api token
|
89
|
+
@auth = "Basic #{Base64.strict_encode64("#{@email + ":" + @jira_api_token}")}"
|
90
|
+
|
87
91
|
response = RestClient.post(
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
92
|
+
"#{@base_url}/rest/api/2/issue/",
|
93
|
+
payload.to_json,
|
94
|
+
headers = {
|
95
|
+
content_type: :json,
|
96
|
+
:Authorization => @auth
|
97
|
+
}
|
94
98
|
)
|
95
99
|
|
96
|
-
#extract the key
|
100
|
+
# extract the key
|
97
101
|
@response = JSON.parse response.gsub(':', ':')
|
98
102
|
@issue_key = @response["key"]
|
99
103
|
|
100
|
-
|
101
|
-
#
|
102
|
-
#get the assignee id - by clicking on profile link : which will something like
|
104
|
+
# Assign the issue to someone
|
105
|
+
# get the assignee id - by clicking on profile link : which will something like
|
103
106
|
# https://abcperson.atlassian.net/jira/people/67gv54hmnj8798ujhhu
|
104
107
|
# After - people what is there is the acount id :
|
105
108
|
|
106
|
-
#request - put
|
109
|
+
# request - put
|
107
110
|
# endpoint : https://abcperson.atlassian.net/rest/api/2/issue/Issue-ID/assignee
|
108
111
|
# body : {"accountID" : "67gv54hmnj8798ujhhu"}
|
109
112
|
# expected response - 204
|
110
113
|
|
111
|
-
|
112
114
|
payload =
|
113
|
-
|
114
|
-
|
115
|
-
|
115
|
+
{
|
116
|
+
"accountId": assignee_id
|
117
|
+
}
|
116
118
|
|
117
119
|
url = "#{@base_url}/rest/api/2/issue/#{@issue_key}/assignee"
|
118
120
|
|
119
121
|
response = RestClient.put(
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
122
|
+
url,
|
123
|
+
payload.to_json,
|
124
|
+
headers = {
|
125
|
+
# content_type: 'application/json',
|
126
|
+
content_type: :json,
|
127
|
+
# accept: :json,
|
128
|
+
# accept: 'application,json',
|
129
|
+
:Authorization => "Basic #{@jira_api_token}"
|
130
|
+
}
|
129
131
|
)
|
130
132
|
i += 1
|
131
133
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: createissue_jira
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
|
-
-
|
7
|
+
- SachinPatel
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-01-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rest-client
|
@@ -92,27 +92,40 @@ dependencies:
|
|
92
92
|
version: 0.1.0
|
93
93
|
description: Write a longer description or delete this line.
|
94
94
|
email:
|
95
|
-
-
|
95
|
+
- sachinpatel8890@outlook.com
|
96
96
|
executables: []
|
97
97
|
extensions: []
|
98
98
|
extra_rdoc_files: []
|
99
99
|
files:
|
100
|
+
- ".idea/.gitignore"
|
101
|
+
- ".idea/createissue_jira.iml"
|
102
|
+
- ".idea/misc.xml"
|
103
|
+
- ".idea/modules.xml"
|
104
|
+
- ".idea/vcs.xml"
|
100
105
|
- CHANGELOG.md
|
101
106
|
- CODE_OF_CONDUCT.md
|
102
107
|
- Gemfile
|
108
|
+
- Gemfile.lock
|
103
109
|
- LICENSE.txt
|
104
110
|
- README.md
|
105
111
|
- Rakefile
|
112
|
+
- createissue_jira-0.1.0.gem
|
113
|
+
- createissue_jira-0.1.1.gem
|
114
|
+
- createissue_jira-0.1.5.gem
|
115
|
+
- createissue_jira-0.1.6.gem
|
116
|
+
- createissue_jira-0.1.7.gem
|
117
|
+
- createissue_jira-0.1.8.gem
|
118
|
+
- createissue_jira.gemspec
|
106
119
|
- lib/createissue_jira.rb
|
107
120
|
- lib/createissue_jira/version.rb
|
108
121
|
- sig/createissue_jira.rbs
|
109
|
-
homepage: https://
|
122
|
+
homepage: https://github.com/Sachin8890/createissue_jira
|
110
123
|
licenses:
|
111
124
|
- MIT
|
112
125
|
metadata:
|
113
126
|
allowed_push_host: https://rubygems.org
|
114
|
-
homepage_uri: https://
|
115
|
-
source_code_uri: https://
|
127
|
+
homepage_uri: https://github.com/Sachin8890/createissue_jira
|
128
|
+
source_code_uri: https://github.com/Sachin8890/createissue_jira
|
116
129
|
changelog_uri: https://rubygems.org
|
117
130
|
post_install_message:
|
118
131
|
rdoc_options: []
|
@@ -129,9 +142,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
129
142
|
- !ruby/object:Gem::Version
|
130
143
|
version: '0'
|
131
144
|
requirements: []
|
132
|
-
|
133
|
-
rubygems_version: 2.7.6
|
145
|
+
rubygems_version: 3.1.6
|
134
146
|
signing_key:
|
135
147
|
specification_version: 4
|
136
|
-
summary:
|
148
|
+
summary: This gem can be use to create a jira ticket specifically for the QA test
|
149
|
+
case under Jira Epic
|
137
150
|
test_files: []
|