Getting Host Parameter Error With ServiceNow to Jira Integration.

priscillaoc
Tera Contributor

Hello everyone,

I'm trying to integrate ServiceNow with Jira, but I keep getting an error when testing the HTTP method. The error I get is,

 

"Request not sent to uri=https//rest/api/3/issue : java.lang.IllegalArgumentException: host parameter is null"

 

Here’s what I did:

1. Created two new fields on the Incident form

Label: Project Key
Type: String
Max Length: 100


Label: Jira Issue Key
Type: String
Max Length: 100

2. Generated a Jira API token

3. Created an Outbound REST Message
Label: Jira Integration
Endpoint: (filled in correctly)

Authentication Type: Basic
Basic auth profile: Jira Auth (created this)


4. Created the HTTP Method
Label: Create Jira Issue
HTTP Headers:
Content-Type: application/json
Accept: application/json

5. Scripted the request content:

// Get Incident number and short description

var number = current.number;
var short_description = current.short_description;

var projectKey = "SI";
var summary = "Incident from ServiceNow: " + number;
var description = "Details: " + short_description;

 

gs.info("Project Key: " + projectKey);
gs.info("Summary: " + summary);
gs.info("Description: " + description);

 

var jiraRequest = {
"fields": {
"project": { "key": projectKey },
"summary": summary,
"description": description,
"issuetype": { "name": "Bug" }
}
};

Despite filling in the endpoint for both the REST Message and the HTTP Method, I still get the "host parameter is null" error. Any guidance or suggestions would be greatly appreciated.

Thank you.

 

1 REPLY 1

Viraj Hudlikar
Tera Sage

Hello @priscillaoc 

 

The error "host parameter is null" is almost certainly due to an incorrect or malformed URL in your REST Message Endpoint or the HTTP Method Endpoint.

In your error message: Request not sent to uri=https//rest/api/3/issue : java.lang.IllegalArgumentException: host parameter is null, notice the missing colon after https (it shows https//... instead of https://...).

 

If my response has helped you, hit the helpful button, and if your concern is solved, do mark my response as correct.

 

Thanks & Regards
Viraj Hudlikar.