Contents
End Point: /ihubservice/api/smartops/ihub/scanner
Headers: Organization-name:ustglobal
Organization-key:1
Authorization:<bearer-token>
user:smartops
Content-Type:application/json
Sysparam_query: Query for retrieving data from snow, it can be changed as per user requirement
channelName: Name of the channel
SNOW Username: ServiceNow Username
SNOW Password: ServiceNow Password
namespace: Namespace of the corresponding env. Eg: for dev it is “itopsv1-dev03”
Request Method: POST
Request body:
{
"requestMethod": "GET",
"url": "https://ustglobaldev.service-now.com/api/now/table/incident",
"authMethod": "BASIC",
"filterParams": {
"sysparm_fields": "number,sys_id,sys_created_on,description,assigned_to,assignment_group,urgency,short_description,state,priority,category,sub_categotry,work_notes,caller_id,caller_id,sys_created_by,sys_updated_on,sys_updated_by,resolved_at,resolved_by,comments,severity",
"sysparm_query": "sys_created_onRELATIVEGT@minute@ago@7%5EORsys_updated_onRELATIVEGT@minute@ago@7%5esys_domainLIKEninety%20one",
"sysparm_display_value": "true"
},
"jsonRequest": "",
"pollingSchedule": "0 0/5 * * * ?",
"cronScheduler": true,
"orgId": 1,
"channelName": <channelName>,
"userName": <SNOW Username>,
"password": <SNOW Password>,
"active": true,
"projectId": <project ID>,
"source": "Pwf",
"projectName": <Project Name>,
"destinations": [
{
"destinationType": "API",
"apiRequestMethod": "POST",
"apiUrl": "http://<namespace>-itops-services:9020/api/ticketstore",
"apiHeaders": {
"organization-key": 1,
"offline-token": <offline-token>,
"Organization-name": "USTGlobal",
"user": "smartops"
},
"apiAuthType": "NO_AUTH",
"jsonMappings": {
"jsonSpecs": [
{
"operation": "shift",
"mappings": {
"result/*/description": "senseParams.longDescription",
"result/*/sys_id": "senseParams.sysId",
"result/*/number": "senseParams.ticketNumber",
"result/*/assigned_to/display_value": "senseParams.assignedTo",
"result/*/assignment_group/display_value": "senseParams.assignedGroup",
"result/*/urgency": "senseParams.urgency",
"result/*/short_description": "senseParams.shortDescription",
"result/*/state": "senseParams.ticketStatus",
"result/*/priority": "senseParams.ticketPriority",
"result/*/category": "senseParams.category",
"result/*/sub_category": "senseParams.subCategory",
"result/*/work_notes": "senseParams.workNotes",
"result/*/caller_id/display_value": "senseParams.callerId",
"result/*/sys_created_on": "senseParams.createdTime",
"result/*/sys_created_by": "senseParams.createdBy",
"result/*/sys_updated_on": "senseParams.updatedTime",
"result/*/sys_updated_by": "senseParams.updatedBy",
"result/*/resolved_at": "senseParams.resolvedTime",
"result/*/resolved_by/display_value": "senseParams.resolvedBy",
"result/*/severity": "senseParams.ticketSeverity",
"result/*/close_notes": "senseParams.closureNotes",
"result/*/comments": "senseParams.comments"
}
},
{
"operation": "default",
"mappings": {
"*/senseParams/processType": "incident"
}
}
]
},
"apiFilterParams": null
}
],
"processInputasList": true
}
End Point: /ihubservice/api/smartops/ihub/scanner
Headers: Organization-name:ustglobal
Organization-key:1
Authorization:<bearer-tocken>
user:smartops
Content-Type:application/json
Sysparam_query: Query for retrieving data from snow, it can be changed as per user requirement
channelName: Name of the channel
SNOW Username: ServiceNow Username
SNOW Password: ServiceNow Password
namespace: Namespace of the corresponding env. Eg: for dev it is “itopsv1-dev03”
Request body:
{
"requestMethod": "GET",
"url": "https://ustglobaldev.service-now.com/api/now/table/incident",
"authMethod": "BASIC",
"filterParams": {
"sysparm_fields": "number,sys_id,sys_created_on,description,assigned_to,assignment_group,urgency,short_description,state,priority,category,sub_categotry,work_notes,caller_id,caller_id,sys_created_by,sys_updated_on,sys_updated_by,resolved_at,resolved_by,severity",
"sysparm_query": "sys_created_onRELATIVEGT@minute@ago@7%5EORsys_updated_onRELATIVEGT@minute@ago@7%5esys_domainLIKEninety%20one",
"sysparm_display_value": "true"
},
"jsonRequest": "",
"pollingSchedule": "0 0/5 * * * ?",
"cronScheduler": true,
"orgId": 1,
"channelName": <channelName>,
"userName": <SNOW Username>,
"password": <SNOW Password>,
"active": true,
"projectId": <project ID>,
"source": "Pwf",
"projectName": <Project Name>,
"destinations": [
{
"destinationType": "API",
"apiRequestMethod": "POST",
"apiUrl": "http://<namespace>-itops-services:9020/api/ticketstore",
"apiHeaders": {
"organization-key": 1,
"offline-token": <offline-token>,
"Organization-name": "USTGlobal",
"user": "smartops"
},
"apiAuthType": "NO_AUTH",
"jsonMappings": {
"jsonSpecs": [
{
"operation": "shift",
"mappings": {
"result/*/description": "senseParams.longDescription",
"result/*/sys_id": "senseParams.sysId",
"result/*/number": "senseParams.ticketNumber",
"result/*/assigned_to/display_value": "senseParams.assignedTo",
"result/*/assignment_group/display_value": "senseParams.assignedGroup",
"result/*/urgency": "senseParams.urgency",
"result/*/short_description": "senseParams.shortDescription",
"result/*/state": "senseParams.ticketStatus",
"result/*/priority": "senseParams.ticketPriority",
"result/*/category": "senseParams.category",
"result/*/sub_category": "senseParams.subCategory",
"result/*/work_notes": "senseParams.workNotes",
"result/*/caller_id/display_value": "senseParams.callerId",
"result/*/sys_created_on": "senseParams.createdTime",
"result/*/sys_created_by": "senseParams.createdBy",
"result/*/sys_updated_on": "senseParams.updatedTime",
"result/*/sys_updated_by": "senseParams.updatedBy",
"result/*/resolved_at": "senseParams.resolvedTime",
"result/*/resolved_by/display_value": "senseParams.resolvedBy",
"result/*/severity": "senseParams.ticketSeverity",
"result/*/close_notes": "senseParams.closureNotes"
}
},
{
"operation": "default",
"mappings": {
"*/senseParams/processType": "incident"
}
}
]
},
"apiFilterParams": null
}
],
"processInputasList": true
}
End Point: /ihubservice/api/smartops/ihub/scanner
Headers: Organization-name:ustglobal
Organization-key:1
Authorization:<bearer-token>
user:smartops
Content-Type:application/json
Sysparam_query: Query for retrieving data from snow, it can be changed as per user requirement
channelName: Name of the channel
SNOW Username: ServiceNow Username
SNOW Password: ServiceNow Password
namespace: Namespce of the corresponding env. Eg: for dev it is “itopsv1-dev03”
Request body:
{
"requestMethod": "GET",
"url": "https://ustglobaldev.service-now.com/api/now/table/task_sla",
"authMethod": "BASIC",
"filterParams": {
"sysparm_fields": "task,business_duration,business_time_left",
"sysparm_query": "sys_created_onRELATIVEGT@minute@ago@15%5EORsys_updated_onRELATIVEGT@minute@ago@15%5esys_domainLIKEninety%20one",
"sysparm_display_value": "true"
},
"jsonRequest": "",
"pollingSchedule": "0 0/5 * * * ?",
"cronScheduler": true,
"orgId": 1,
"channelName": <channelName>,
"userName": <SNOW Username>,
"password": <SNOW Password>,
"active": true,
"projectId": <project ID>,
"source": "Pwf",
"projectName": <Project Name>,
"destinations": [
{
"destinationType": "API",
"apiRequestMethod": "POST",
"apiUrl": "http://<namespace>-itops-services:9020/api/ticketstore"
,
"apiHeaders": {
"organization-key": 1,
"offline-token": <offline-token>,
"Organization-name": "USTGlobal",
"user": "smartops"
},
"apiAuthType": "NO_AUTH",
"jsonMappings": {
"jsonSpecs": [
{
"operation": "shift",
"mappings": {
"result/*/task/display_value": "senseParams.ticketNumber",
"result/*/business_time_left": "senseParams.ticketBusinessTimeLeft",
"result/*/business_duration": "senseParams.ticketBusinessDuration" }
},
{
"operation": "default",
"mappings": {
"*/senseParams/processType": "sla"
}
}
]
},
"apiFilterParams": null
}
],
"processInputasList": true
}
End Point: /ihubservice/api/smartops/ihub/scanner
Headers: Organization-name:ustglobal
Organization-key:1
Authorization:<bearer-token>
user:smartops
Content-Type:application/json
Sysparam_query: Query for retrieving data from snow, it can be changed as per user requirement (Initial assignment user and initial assignment group names are to be given here. This should be similar to the id given in templates for reassignment to happen.)
channelName: Name of the channel
SNOW Username: ServiceNow Username
SNOW Password: ServiceNow Password
reAssignmentGroup: Ticket is reassigned to this group. Please update with relevant servicenow group id.
To find sysid of a user, please use below url:
To find sysid of a group, please use below url:
Please replace ‘%20’ instead of space in username/groupname. Example:
If username is ‘ITOps Virtual Engineer’, then value should be ‘ITOps%20Virtual%20%20Engineer’
If groupname is ‘NinetyOne NOC’, then value should be ‘NinetyOne%20NOC’
Example:
assignmentGroup |
assignedGroupId |
ITOpsTesting |
ee199611db12e4104d2e62cb139619ee |
NinetyOne NOC |
efb1e3a0db1f00105ed6776b8c9619c2 |
namespace: Namespace of the corresponding env. e.g. for dev it is “itopsv1-dev03”
Request body:
{
"requestMethod": "GET",
"url": "https://ustglobaldev.service-now.com/api/now/table/incident",
"authMethod": "BASIC",
"filterParams": {
"sysparm_fields": "number,sys_id",
"sysparm_query": "sys_created_onRELATIVELT@minute@ago@5%5Esys_created_onRELATIVEGT@minute@ago@20%5Eassigned_to.name=ITOps%20Virtual%20%20Engineer%5Eassignment_group.name=ITOpsTesting%5EstateNOT%20IN6%2C7%2C9",
"sysparm_display_value": "true"
},
"jsonRequest": "",
"pollingSchedule": "0 0/1 * * * ?",
"cronScheduler": true,
"orgId": 1,
"channelName": <channelName>,
"userName": <SNOW Username>,
"password": <SNOW Password>,
"active": true,
"projectId": <project ID>,
"source": "Pwf",
"projectName": <Project Name>,
"destinations": [
{
"destinationType": "API",
"apiRequestMethod": "POST",
"apiUrl": "http://<namespace>-alertmapping:9010/api/reassignment"
,
"apiHeaders": {
"organization-key": 1,
"offline-token": <offline-token>,
"Organization-name": "USTGlobal",
"user": "smartops"
},
"apiAuthType": "NO_AUTH",
"jsonMappings": {
"jsonSpecs": [
{
"operation": "shift",
"mappings": {
"result/*/sys_id": "senseParams.sysId",
"result/*/number": "senseParams.ticketNumber"
}
},
{
"operation": "default",
"mappings": {
"*/senseParams/reAssignmentGroup": <reAssignmentGroup> (mention group id)
}
}
]
},
"apiFilterParams": null
}
],
"processInputasList": true
}
End Point: /ihubservice/api/smartops/ihub/scanner
Headers: Organization-name:ustglobal
Organization-key:1
Authorization:<bearer-token>
user:smartops
Content-Type:application/json
Sysparam_query: Query for retrieving data from snow, it can be changed as per user requirement
channelName: Name of the channel
SNOW Username: ServiceNow Username
SNOW Password: ServiceNow Password
namespace: Namespace of the corresponding env for dev it is “itopsv1-dev03”
(Not mandatory: Here the pollingSchedule is set to 12 hrs, so only after 12 hrs the source and groups will be present in external teams of configuration tab in a project. To view them as soon as project is created, please change the pollingSchedule to one min(0 0/1 * * * ?), and then go and update in mongodb back to 12 hrs(0 0 12 * * ?))
Request body:
{
"requestMethod": "GET",
"url": "https://ustglobaldev.service-now.com/api/now/table/sys_user_group",
"authMethod": "BASIC",
"filterParams": {
"sysparm_fields": "name,sys_id,description,active",
"sysparm_display_value": "true"
},
"jsonRequest": "",
"pollingSchedule": "0 0 12 * * ?",
"cronScheduler": true,
"orgId": 1,
"channelName": <channelName>,
"userName": <SNOW Username>,
"password": <SNOW Password>,
"active": true,
"projectId": <project ID>,
"source": "Pwf",
"projectName": "userGroupId_Final",
"destinations": [
{
"destinationType": "API",
"apiRequestMethod": "POST",
"apiUrl": "http://<namespace>-itops-services:9020/api/addTeam",
"apiHeaders": {
"organization-key": 1,
"offline-token": <offline-token>,
"Organization-name": "USTGlobal",
"user": "smartops"
},
"apiAuthType": "NO_AUTH",
"jsonMappings": {
"jsonSpecs": [
{
"operation": "shift",
"mappings": {
"result/*/sys_id": "senseParams.teamIdExt",
"result/*/name": "senseParams.teamName",
"result/*/description": "senseParams.description",
"result/*/active": "senseParams.active"
}
},
{
"operation": "default",
"mappings": {
"*/senseParams/source": "Service Now",
"*/senseParams/sourceType": "ITSM"
}
}
]
},
"apiFilterParams": null
}
],
"processInputasList": true
}