API related query in sc_task table

Laxmi4
Giga Contributor

Hi,

I am using the below api:

https://your-instance-url/api/now/table/sc_task?sysparm_query=short_description=Testing^state=1^assi...

 

I want to use the above api as GET. I don't want to use the Id of assigned group and request_item, I want their name in to the api so that I can use them rest anywhere.

Problem:

I had created 2 tasks.

task1 with Short discription : Testing, state : 1, assignment_group : IT Securities , request_item : Access, approval : Approved

task2 with  Short discription : Testing, state : 1,  approval : Approved

When I am executing the api the response I am receiving is not as expected. When I use this api I should receive the response of task1, but I am getting tas1 as well as  task2 in the response.

How can I resolve this issue.

 

1 ACCEPTED SOLUTION

Laxmi4
Giga Contributor

Hi,

Thanks for your support.

The issue is been resolved. One can follow as below to get the solution:

instead of using this api url : https://your-instance-url/api/now/table/sc_task?sysparm_query=short_description=Testing^state=1^assi...

we can use :https://your-instance-url/api/now/table/sc_task?sysparm_query=short_description=Testing^state=1^assi... 

to directly use the group_name and also filelds with their name instead of their id.

 

Thank you.

 

Regards,

Laxmi

View solution in original post

4 REPLIES 4

Masarrat Siddi1
Kilo Guru

Is  short description, assignment group is same for both tasks?

 

 

 

yes.

yes

Laxmi4
Giga Contributor

Hi,

Thanks for your support.

The issue is been resolved. One can follow as below to get the solution:

instead of using this api url : https://your-instance-url/api/now/table/sc_task?sysparm_query=short_description=Testing^state=1^assi...

we can use :https://your-instance-url/api/now/table/sc_task?sysparm_query=short_description=Testing^state=1^assi... 

to directly use the group_name and also filelds with their name instead of their id.

 

Thank you.

 

Regards,

Laxmi