How to approve a catalog task in an ATF

mkader
Kilo Guru

Hello,

I have an ATF that I created. It involves ordering an item from the Service Portal. When I get to the approval process and marking tickets as Closed Complete, I jump to the server section and use the Replay Request Item. This allows me to grab the ticket number.

find_real_file.png

Where my test is failing:

It fails at Step 15. I am trying to do a Record Query to get back the sc_task and close the task, but the error I keep getting is "No records matching query" as shown below:

find_real_file.png

This is what my query step looks like:

find_real_file.png

Once this step is figured out, I want to add a Record Update to close the sc_task.

**Note**

When an item is ordered on our portal, closing the task does not close the RITM and closing the RITM does not close the REQ. This is a manual process. The RITM and SCTASK display as a related list under the REQ at same time and I think that is whats making this so difficult.

 

Thanks!

1 ACCEPTED SOLUTION

Okay thanks for your reply 🙂

I would suggest below steps:

1)- Record Query : sysapproval_approver [Step 13 already in place]

- Approval For: Pass the request item

- Retrieved atleast one record

2) Open an existing record (pass the id return in above step)

3) click a ui action (here please select ui action:approve)

[Note: Please don't use record update to change it to approved] instead use step 2 & 3

If you have some queries please feel to ask:)

 

View solution in original post

16 REPLIES 16

Hi,

Out of the box for catalog item there isn't any approval generated for REQ when item is submitted.

Request gets auto-approved and then RITM workflow triggers.

Are you using the OOB Workflow on Request table?

Did any change happen in that?

Regards
Ankur

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

@Ankur Bawiskar - We are not using the OOB approval for requests. Ours has been modified extensively. the next steps in the workflow for requests is manager approval. Once the approval process gets approved on the request, RITMS workflow kick off and their approval state changes to approved and an SCTASK gets created. My goal is to take the REQ created in the ATF and approve on that through the sysapproval_user table. I did create a second ATF that does not go through the sysapproval_approver table and directly made updates as an admin to the REQ form. This then triggers the RITM workflow and the SCTASK to be created. I can close those with no issue in my alternative test

PriyaRanji
Tera Guru

Hello, 

Good Day!

Are you sure that request state is open? Could you please check while doing manual test - what is the state of request.

May be state doesn't match with request - which is the reason throwing an error.

Thanks,

Priyanka R

Hello @PriyaRanji - Yes I confirmed the Request is in the open state. I have timers setup that allow me time to go through the record and investigate. When I try to approve the sysapprover_approval table I have issues. If I update the approval state directly through the Request, everything works fine

Okay thanks for your reply 🙂

I would suggest below steps:

1)- Record Query : sysapproval_approver [Step 13 already in place]

- Approval For: Pass the request item

- Retrieved atleast one record

2) Open an existing record (pass the id return in above step)

3) click a ui action (here please select ui action:approve)

[Note: Please don't use record update to change it to approved] instead use step 2 & 3

If you have some queries please feel to ask:)