- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-29-2020 03:25 AM
I use Python Script to create tasks in multiple categories,
now i need REST API url which help me to create more TASKS under one RITM/REQ.
anyone did this before?
update:
I have one ritm with one task is present but i want to add more tasks under that RITM, any idea about it?
Thank You in advance
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-11-2020 10:20 PM
My bad. Need to also set "request_item". Change the line setting response to following.
response = requests.post(url, auth=(SERVICENOW_USER, SERVICENOW_PWD), headers=headers,
data="{\"parent\":\"" + task.get('rtim')
+ "\",\"priority\":\"" + task.get('priority')
+ "\",\"state\":\"" + task.get('state')
+ "\",\"short_description\":\"" + task.get('short_description')
+ "\",\"request_item\":\"" + task.get('rtim')
+ "\",\"assignment_group\":\"" + task.get('assignment_group') + "\"}")
Output

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-11-2020 09:29 PM
It's necessary to replace the value of 'rtim' in the following statement with the actual sys_id of the rtim to add the task.
task = {'rtim': 'ab10cc9fdbef901083212a9a48961929',
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-11-2020 09:53 PM
yeah, i changed this value and other payload values as well, payload which i am passing is given below also attaching Screenshot here for reference.
task = {'parent': '324ca6a3dbde98585489fac2f396197d',
'priority': '4',
'state': '1',
'short_description': 'test task created by NANYADAV',
'assignment_group': '2b4357e7db41945092805c83f39619d9'
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-11-2020 10:20 PM
My bad. Need to also set "request_item". Change the line setting response to following.
response = requests.post(url, auth=(SERVICENOW_USER, SERVICENOW_PWD), headers=headers,
data="{\"parent\":\"" + task.get('rtim')
+ "\",\"priority\":\"" + task.get('priority')
+ "\",\"state\":\"" + task.get('state')
+ "\",\"short_description\":\"" + task.get('short_description')
+ "\",\"request_item\":\"" + task.get('rtim')
+ "\",\"assignment_group\":\"" + task.get('assignment_group') + "\"}")
Output
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-11-2020 11:08 PM
yeah, now its working, thank you so much, it solved my crucial issue.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-11-2020 10:20 PM
Hi,
you should send the ritm sys_id like this
{'request_item': 'ritm sysId',
what error you are getting
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader