brpm_module_demo 0.1.14 → 0.1.15

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 CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- NDkwMDM5YzYwYmE0MjkxYzU3MjY4Zjk5OTBkYzY0OWY5OGEzYzczMg==
4
+ NWVjNzdkMWY5OWE3NTBiZGZhMDgxYWE4ZmEwMjhiNTllNGZjMWZiNw==
5
5
  data.tar.gz: !binary |-
6
- OGFlZDE3ZmRjNzYwOWFmYzBlMWNhZmIwZGE5MWE3MDAzYTZiMWU3Yw==
6
+ MGUzYzFmYjE2ZjM1MjQyZTUzOGIwMTRmM2FjYTYyYzRlZjlmYjkwNg==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- MWMzZDIxYzFiZjY3YmNkOGEwNTAyOWNmY2NhZTJiZTY5ZGQwMDQ3NGY2MmIx
10
- YWY3OTI4Y2Y1ZWYzZjM5NDI1MmJiOTE2YzA5MmUxNmM2ZDczOWI4ZTNhMzcy
11
- NmE2Nzk1MTUyNTMwYzg3Mjc3YWM0NDAxOGE0Njg1ZjM4OWE1NWM=
9
+ MGQ5N2Q1NDUxYzdmNTNkZjc0MTcxNDE1M2YzYWM4ZGM3OTk3MmQwMmFhYjM0
10
+ YmZmNjAxOWMyZjJkM2M2YzFjYWY1YzA4MmRkYjYxNjIxM2RhMmI3MjlhNzZi
11
+ NTE2YjAwYjk0MjY3ZmZmY2JiMGI3ZTZkNmYwZmI3MTIwMDU2NjY=
12
12
  data.tar.gz: !binary |-
13
- ODhkMTFmZDM0ZjM4MTU0ZTc1NzM0NGNjNTRkNzMzM2Y1OWEyOWZmZTZiZWI0
14
- NjkxMTg3OTc0NjVlYjA1MTZkZWQxNDg2ZDI1NGUwODRlOWVmZDUxYjU0Zjlk
15
- ZGQyMTYwOGJkMTE2MjU3NmFiMmIwYzdlYjYwNjFmNDI0OWJlZjU=
13
+ NWI0OTkyZWIyOTc0Nzc1N2FhMDk5NGVkZmViZjI2NzQ2ZTE5MWJmYTg4Mzg1
14
+ NDUxNTBhZTE2YWZlOTVjNjRjNjc4YTk5ZjQ5NmE4NjA5NzFhYTQ1MDczNzVl
15
+ MDEzOGNiNjNmN2YwMzYwZGE1M2FiMDlhYTkxOWExOGVmNTMwMDA=
data/config.yml CHANGED
@@ -2,7 +2,7 @@ dependencies:
2
2
  - brpm_module_brpm
3
3
  - brpm_module_jira
4
4
 
5
- version: 0.1.14
5
+ version: 0.1.15
6
6
 
7
7
  author: Niek Bartholomeus
8
8
  email: niek.bartholomeus@gmail.com
@@ -0,0 +1,51 @@
1
+ # Service-Now to BRPM integration
2
+ ## Intro
3
+ This integration will automatically create a request in BRPM when a new change request is created in Service-Now. This is just a first step in integration Service-Now with BRPM. It can easily be extended to cover more complex integration needs.
4
+
5
+ ## Getting started
6
+ ### Run the webhook receiver as a daemon
7
+ This script should be used with a [webhook_receiver wrapper](https://github.com/BMC-RLM/brpm_content_framework/blob/master/infrastructure/scripts/run_webhook_receiver.sh). Set the environment variable ```WEBHOOK_RECEIVER_PROCESS_EVENT_SCRIPT``` to the location of this script and execute it in daemon mode: ```nohup ./run_webhook_receiver.sh &```
8
+
9
+ ### Create a request template in BRPM
10
+ Create one or more request templates with the name "[Template] Self Service - <automation type>" where automation_type can be "Reboot server", etc.
11
+
12
+ ### Configuring Service-Now
13
+ _ Create a new dropdown field for a change request with the name u_choice_automation_type and configure a nmber of choices like "Reboot server" etc.
14
+
15
+ - Create an outbound REST Message and set the endpoint to http://your-server:port/webhooks (only the POST HTTP method is needed so you may delete the others)
16
+
17
+ - In the POST HTTP method, specify the content you want to send to the process_webhook_receiver.rb script in json format and create variables substitutions for each of the variables
18
+
19
+ You can use this content as an example:
20
+ ```
21
+ {"change_request": {"number":"${number}", "automation_type":"${automation_type}", "cmdb_ci":"${cmdb_ci}"}}
22
+ ```
23
+
24
+ - Copy the generated javascript code from the "Preview Script Usage" link
25
+
26
+ - Create a business rule and have it trigger after a change request is created
27
+
28
+ - Pass it the generated javascript code and adapt the field values to the change request's field
29
+
30
+ As an example of a javascript piece of code:
31
+ ```
32
+ function onAfter(current, previous) {
33
+ try {
34
+ var r = new sn_ws.RESTMessageV2('BRPM', 'post');
35
+ r.setStringParameter('number', current.number);
36
+ r.setStringParameter('automation_type', current.u_choice_automation_type);
37
+ r.setStringParameter('cmdb_ci', current.cmdb_ci);
38
+ var response = r.execute();
39
+ var responseBody = response.getBody();
40
+ var httpStatus = response.getStatusCode();
41
+ }
42
+ catch(ex) {
43
+ var message = ex.getMessage();
44
+ }
45
+ }
46
+ ```
47
+
48
+ Voila, we're all set. Now create a change request and see how it triggers a new request in BRPM!
49
+
50
+
51
+
@@ -11,7 +11,7 @@ def process_event(event)
11
11
  request_params["target_path_or_servers"] = change_request["cmdb_ci"]
12
12
  request_params["change_request_number"] = change_request["number"]
13
13
 
14
- @brpm_rest_client.create_request("[Template] Tieto Self Service - #{change_request["automation_type"]}", "Tieto Self Service - #{change_request["automation_type"]} - #{change_request["number"]}","Production", true, request_params)
14
+ @brpm_rest_client.create_request("[Template] Self Service - #{change_request["automation_type"]}", "Self Service - #{change_request["automation_type"]} - #{change_request["number"]}","Production", true, request_params)
15
15
 
16
16
  BrpmAuto.log "Finished processing the event."
17
17
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: brpm_module_demo
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.14
4
+ version: 0.1.15
5
5
  platform: ruby
6
6
  authors:
7
7
  - Niek Bartholomeus
@@ -102,6 +102,7 @@ files:
102
102
  - lib/integrations/jenkins/spec/api/requests_spec.rb
103
103
  - lib/integrations/jenkins/spec/spec_helper.rb
104
104
  - lib/integrations/jira/process_webhook_event.rb
105
+ - lib/integrations/servicenow/README.md
105
106
  - lib/integrations/servicenow/process_webhook_event.rb
106
107
  - lib/jira_mappings.rb
107
108
  - module.gemspec