Skip to content
This repository has been archived by the owner on Oct 25, 2019. It is now read-only.

Commit

Permalink
Merge pull request #17 from xebialabs-community/mandeep
Browse files Browse the repository at this point in the history
Fixed Configuration Test for OAuth resource
  • Loading branch information
mandeepmehra committed Mar 20, 2017
2 parents 9dcfc4f + 86134a6 commit a1e3527
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Expand Up @@ -10,7 +10,7 @@ deploy:
provider: releases
api_key:
secure: MDy/R3WGvW3rGg9YEEBzGkZtKMK8EEwR/+xoX2ynXrEKGGiXEmCLeJ1i+X5v1N+Wn7y86t9zkwBtMRgWDbHOQMPRv+XcBpJXIKbS+KSkzKbDVEBk9m8Qh8XxhSDUWhjIBiVfUe4/jrEVHE9vIXGFoikLMf9IQyLgeOEkLDLs6ag=
file: build/libs/xlr-servicenow-plugin-4.1.4.jar
file: build/libs/xlr-servicenow-plugin-4.1.5.jar
skip_cleanup: true
on:
all_bracnhes: true
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Expand Up @@ -19,7 +19,7 @@ apply plugin: 'idea'
apply plugin: 'eclipse'
apply plugin: 'maven'

version='4.1.4'
version='4.1.5'

license {
header rootProject.file('src/main/license/xebialabs_community.license')
Expand Down
12 changes: 11 additions & 1 deletion src/main/resources/servicenow/Server.py
Expand Up @@ -8,7 +8,17 @@
import com.xhaus.jyson.JysonCodec as json
from servicenow.ServiceNowClient import ServiceNowClient

params = { 'url': configuration.url, 'username' : configuration.username, 'password': configuration.password, 'proxyHost': configuration.proxyHost, 'proxyPort': configuration.proxyPort }
params ={
'url':configuration.url, 'username':configuration.username
, 'password':configuration.password,'useOAuth':configuration.useOAuth
, 'oauthUsername':configuration.oauthUsername, 'oauthPassword':configuration.oauthPassword
, 'clientId':configuration.clientId, 'clientSecret':configuration.clientSecret
, 'proxyHost': configuration.proxyHost, 'proxyPort':configuration.proxyPort
, 'changeRecordTableName': configuration.changeRecordTableName
, 'changeTaskTableName': configuration.changeTaskTableName
, 'sysparmDisplayValue' : configuration.sysparmDisplayValue
, 'sysparmInputDisplayValue' : configuration.sysparmInputDisplayValue
}

snClient = ServiceNowClient.create_client(params)
content = None
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/servicenow/ServiceNowClient.py
Expand Up @@ -47,7 +47,7 @@ def get_change_request_states(self):

def get_scorecards(self):
servicenow_api_url = '/api/now/v1/pa/scorecards'
response = self.httpRequest.get(servicenow_api_url, contentType='application/json')
response = self.httpRequest.get(servicenow_api_url, contentType='application/json', headers = self.headers)
self.revoke_token()
if response.getStatus() == SN_RESULT_STATUS:
data = json.loads(response.getResponse())
Expand Down
3 changes: 0 additions & 3 deletions src/main/resources/synthetic.xml
Expand Up @@ -86,10 +86,7 @@
#######################################################################################################################
-->
<type type="servicenow.CreateChangeRequest" extends="servicenow.CreateRecord">

<property name="tableName" category="input" label="Table Name" default="change_request" required="true" hidden="true" />
<property name="scriptLocation" default="servicenow/CreateChangeRequest.py" hidden="true" />

</type>

<type type="servicenow.UpdateChangeRequest" extends="servicenow.UpdateRecord">
Expand Down

0 comments on commit a1e3527

Please sign in to comment.