pwn 0.5.458 → 0.5.460
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +3 -3
- data/lib/pwn/plugins/jira_server.rb +54 -1
- data/lib/pwn/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: e0fd4b3e503df4cf02f8ebfd3e74650492432f45621f08bd9b7089443dfa5e4c
|
|
4
|
+
data.tar.gz: 0f98ea5d9af915e0cc094ec7659ddae8ce6ce17ef0bd95e11356b43e0832972b
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 8dcbcb9f1f2b919dde7faad6bbfa922351013e0fc793de1d4953fb412b305fb654f9842dabdfce07f3fa2661e55402a23b12e091240318fa149c7c89821f32fe
|
|
7
|
+
data.tar.gz: 7dd9700299cf76c776057f9b2c51ee7508d7301345e9ec52096cab4d7a8e41ee4300935b50e7fe9c630be3a53a7f35036f91246ffd7b70233b60be7d18965905
|
data/README.md
CHANGED
|
@@ -37,7 +37,7 @@ $ cd /opt/pwn
|
|
|
37
37
|
$ ./install.sh
|
|
38
38
|
$ ./install.sh ruby-gem
|
|
39
39
|
$ pwn
|
|
40
|
-
pwn[v0.5.
|
|
40
|
+
pwn[v0.5.460]:001 >>> PWN.help
|
|
41
41
|
```
|
|
42
42
|
|
|
43
43
|
[](https://youtu.be/G7iLUY4FzsI)
|
|
@@ -52,7 +52,7 @@ $ rvm use ruby-3.4.4@pwn
|
|
|
52
52
|
$ gem uninstall --all --executables pwn
|
|
53
53
|
$ gem install --verbose pwn
|
|
54
54
|
$ pwn
|
|
55
|
-
pwn[v0.5.
|
|
55
|
+
pwn[v0.5.460]:001 >>> PWN.help
|
|
56
56
|
```
|
|
57
57
|
|
|
58
58
|
If you're using a multi-user install of RVM do:
|
|
@@ -62,7 +62,7 @@ $ rvm use ruby-3.4.4@pwn
|
|
|
62
62
|
$ rvmsudo gem uninstall --all --executables pwn
|
|
63
63
|
$ rvmsudo gem install --verbose pwn
|
|
64
64
|
$ pwn
|
|
65
|
-
pwn[v0.5.
|
|
65
|
+
pwn[v0.5.460]:001 >>> PWN.help
|
|
66
66
|
```
|
|
67
67
|
|
|
68
68
|
PWN periodically upgrades to the latest version of Ruby which is reflected in `/opt/pwn/.ruby-version`. The easiest way to upgrade to the latest version of Ruby from a previous PWN installation is to run the following script:
|
|
@@ -218,6 +218,7 @@ module PWN
|
|
|
218
218
|
epic_name_field_key = all_fields.find { |field| field[:name] == 'Epic Name' }[:id]
|
|
219
219
|
|
|
220
220
|
epic_name = opts[:epic_name]
|
|
221
|
+
raise 'ERROR: epic_name cannot be nil when issue_type is :epic.' if issue_type == :epic && epic_name.nil?
|
|
221
222
|
|
|
222
223
|
http_body = {
|
|
223
224
|
fields: {
|
|
@@ -267,7 +268,20 @@ module PWN
|
|
|
267
268
|
)
|
|
268
269
|
end
|
|
269
270
|
|
|
270
|
-
|
|
271
|
+
created_issue = nil
|
|
272
|
+
get_issue_attempts = 0
|
|
273
|
+
max_get_issue_attempts = 7
|
|
274
|
+
begin
|
|
275
|
+
created_issue = get_issue(issue: issue)
|
|
276
|
+
rescue RuntimeError
|
|
277
|
+
raise 'ERROR: Max attempts reached for retrieving created issue.' if get_issue_attempts > max_get_issue_attempts
|
|
278
|
+
|
|
279
|
+
get_issue_attempts += 1
|
|
280
|
+
sleep 1
|
|
281
|
+
retry
|
|
282
|
+
end
|
|
283
|
+
|
|
284
|
+
created_issue
|
|
271
285
|
rescue StandardError => e
|
|
272
286
|
raise e
|
|
273
287
|
end
|
|
@@ -370,6 +384,41 @@ module PWN
|
|
|
370
384
|
raise e
|
|
371
385
|
end
|
|
372
386
|
|
|
387
|
+
# Supported Method Parameters::
|
|
388
|
+
# issue_resp = PWN::Plugins::JiraServer.clone_issue(
|
|
389
|
+
# issue: 'required - issue to clone (e.g. Bug, Issue, Story, or Epic ID)'
|
|
390
|
+
# )
|
|
391
|
+
|
|
392
|
+
public_class_method def self.clone_issue(opts = {})
|
|
393
|
+
issue = opts[:issue]
|
|
394
|
+
raise 'ERROR: issue cannot be nil.' if issue.nil?
|
|
395
|
+
|
|
396
|
+
issue_data = get_issue(issue: issue)
|
|
397
|
+
|
|
398
|
+
project_key = issue_data[:fields][:project][:key]
|
|
399
|
+
summary = "CLONE - #{issue_data[:fields][:summary]}"
|
|
400
|
+
issue_type = issue_data[:fields][:issuetype][:name].downcase.to_sym
|
|
401
|
+
epic_name = nil
|
|
402
|
+
if issue_type == :epic
|
|
403
|
+
all_fields = get_all_fields
|
|
404
|
+
epic_name_field_key = all_fields.find { |field| field[:name] == 'Epic Name' }[:id]
|
|
405
|
+
epic_name = issue_data[:fields][epic_name_field_key.to_sym]
|
|
406
|
+
end
|
|
407
|
+
description = issue_data[:fields][:description]
|
|
408
|
+
additional_fields = { fields: issue_data[:fields] }
|
|
409
|
+
|
|
410
|
+
create_issue(
|
|
411
|
+
project_key: project_key,
|
|
412
|
+
summary: summary,
|
|
413
|
+
issue_type: issue_type,
|
|
414
|
+
epic_name: epic_name,
|
|
415
|
+
description: description,
|
|
416
|
+
additional_fields: additional_fields
|
|
417
|
+
)
|
|
418
|
+
rescue StandardError => e
|
|
419
|
+
raise e
|
|
420
|
+
end
|
|
421
|
+
|
|
373
422
|
# Supported Method Parameters::
|
|
374
423
|
# issue_resp = PWN::Plugins::JiraServer.delete_issue(
|
|
375
424
|
# issue: 'required - issue to delete (e.g. Bug, Issue, Story, or Epic ID)'
|
|
@@ -453,6 +502,10 @@ module PWN
|
|
|
453
502
|
comment: 'optional - comment to add or update in the issue (e.g. \"This is a comment\")'
|
|
454
503
|
)
|
|
455
504
|
|
|
505
|
+
issue_resp = #{self}.clone_issue(
|
|
506
|
+
issue: 'required - issue to clone (e.g. Bug, Issue, Story, or Epic ID)'
|
|
507
|
+
)
|
|
508
|
+
|
|
456
509
|
issue_resp = #{self}.delete_issue(
|
|
457
510
|
issue: 'required - issue to delete (e.g. Bug, Issue, Story, or Epic ID)'
|
|
458
511
|
)
|
data/lib/pwn/version.rb
CHANGED