Catalog Builder approval frustration

matthew_magee1
Giga Guru

Hey all,

Having a heck of a time trying to configure the subflow that fires when a catalog item is submitted.

Per the docs, I made a copy of Catalog Builder - Item review subflow and I've verified the subflow is being hit because I've added log statements.

I also watched the video on the docs site but I'm not able to follow what they did and apply it to my own process.

BTW, I'm new to flow designer so that doesn't help.

Here's what I want to do:

  1. Catalog Builder user creates or edits a catalog item via Builder
  2. User submits item in Builder
  3. Group X is notified when a catalog item has been submitted via Builder
  4. User in Group X reviews changes and either Approves or Rejects changes 
  5. If approved, item is published
  6. If rejected, user in Group X has to supply comments. Item goes back to draft and Catalog Builder user/updater is notified 
  7. Catalog Builder user makes changes and submits item in Builder.
  8. Jump to step 3

This seems very simple to do in my head but I struggling. If anyone has screenshots or previous experience they can share, I'd love to hear it-

Thanks

17 REPLIES 17

matthew_magee1
Giga Guru

In my head everything seems to work as we've discussed. Now time to try it out. Stay tuned. Thanks again for following through and listening to me vent

I got this working on our self hosted instance. I'll try to replicate what I did on my low side instance.

BLUF: I am kicking off the catalog builder process using flow designer but because I have a lot of actions (and I'm not a fan of flow designer), I am pointing to a workflow in workflow editor (#workflowEditorRocks)

DavidB-ADT
Tera Guru

Edit: Been made aware that the referenced video is no longer available. I've updated this response with more detail, and also attached my update set.

 

I've just successfully built this approvals mechanism, after watching the video you referenced. The main reply you got doesn't seem quite correct, so going to post my solution here for anyone that needs it.

 

First up, here's an image showing all the components required from my update set. I'll walk through each line item below described in their logical order, not image order.

Catalog Builder Approvals Mechanism.png

Item 1. Action Type - Generate Catalog Builder URL

This is the 'custom' action mentioned in the video (2:33 mark) to generate the catalog item preview URL.

I've got a separate post that details how to build this custom action here, so I won't repeat the details here.

 

Item 2. Catalog Item - Review and publish catalog item

What's kind of glanced over quickly in the video is that you have to create a new catalog item, which this approval subflow will then generate to request the approval and track the response. They show the catalog item from the 3:09 mark, and it's configured like this:

Name: Review and publish catalog item

Short description: Publish catalog item

Variables: (these are Items 10, 11, and 12 in my update set, described below)

Process Engine - Flow: Catalog Item Approval (Item 3, described below)

 

Item 10. Variable - Catalog Item Preview

This catalog item variable is populated by the subflow with the preview URL from Action Type above.

Type: URL

Order: 300

Question: Catalog Item Preview

Name: preview_url

Tooltip: Link to Catalog Item Preview

 

Item 11. Variable - Catalog Item Record

Optional - I added this to also provide a link to the catalog item record, since the preview doesn't allow you to review things like fulfillment steps, etc. I added extra code to the Action Type above to generate this URL in addition to the Preview URL.

Type: URL

Order: 200

Question: Catalog Item Record

Name: catalog_item_url

Tooltip: Link to Catalog Item record

 

Item 12. Variable - Catalog Item

This catalog item variable is populated by the subflow, and just provides the catalog item name/reference.

Type: Reference

Order: 100

Question: Catalog Item Preview

Name: catalog_item

Type Selection - Reference: Catalog Item [sc_cat_item]

 

Items 5, 6, 7, 8. Group - Catalog Admins

This is a Group called Catalog Admins, which will serve as the approvers for any Catalog Builder submission.

I made it an Approval Group Type (Item 8), and gave it the catalog_admin Role (Item 7), so this also doubles up as a group that gives people permission to make Catalog Builder templates.

 

Item 3. Flow - Catalog Item Approval

This is the flow associated with the Catalog Item (item 2). It's shown from the 3:33 mark in the video, but not in a lot of detail. The one in the video is also flawed, so I'll highlight what isn't shown in the video, as well as what's missing in their flow that I had to add to make this work. Basically, the flow they show doesn't work for rejections.

Catalog Item Approval Flow.png

Step 1. Ask for Approval: Use the 'Approve of Reject' rule, and select your Catalog Admins approval group (Items 5-8)

Step 4. Update RITM: This isn't in the video, I added this to set the RITM Approval = Rejected, and State = Closed Skipped. If you don't add this step, then the subflow won't complete, since it waits for the RITM to made inactive to finish its processing.

Step 9. Update RITM. Again, not in the video. I added this to set the RITM Approval = Approved, and State = Closed Complete. If you don't add this step, then the subflow won't complete, since it waits for the RITM to made inactive to finish its processing.

Step 10. Log: Additional log entry I added for step 9.

 

Item 4. Flow - Catalog Builder - Item Review

This is the main subflow discussed in the video, starting from the 1:42 mark. The video covers this in good detail, and there's nothing wrong with it.

Video is no longer available, so here's a screenshot of the flow:

DavidBADT_0-1740704668484.png

You need a string input and output, as shown.

Step 2: Look up record action; table = sc_cat_item; condition = Sys ID is input>catalog item

Step 3: This is the custom Action covered in Item 1 above

Step 4: Submit Catalog Item action; Catalog item = Review and Publish Catalog Item [Item 2 above]; variables as follows:

DavidBADT_1-1740705007986.png

Step 5: Wait For Condition action; wait for catalog item to become inactive.

Steps 6-11: If catalog item state = closed complete, then set the State output variable = completed. Else, set State output variable = failed. (This state value is used by the 'Catalog Builder - Item review base flow' flow, so you must use these values)

 

Item 9. System Property - glide.sc.builder.item_review_flow

This is the system property you need to create and populate with the SysId of the subflow (Item 4). This is detailed at the 6:03 mark. This is required to activate your approval flow as part of a Catalog Builder submission.

Thanks David. I got the approval workflow working with the 2 URL generator and it works great. 

 

I would like to enhance it to only require the approval when the catalog item is fully ready for deployment. This would allow the catalog editor to publish their item to do more testing to support iterative development without burdening the approval group each time. I created a step, section and question in the create catalog item wizard but I am unsure how to make those values available to the down stream flow to use those values to skip the approval RITM and have t get published. This is setup in our test instance and we will only require the approval when the item it ready for official UAT.

I figured out an easy way to bypass the approval process. Since we are doing this in test I created a category Development in the Service Catalog and then put logic in the Catalog Builder - Item review subflow to first check the category and if it is Development just set the output variable State to completed and end the subflow not creating the Review and Publish Catalog Item.

I would be interested in learning how I could use the create catalog item wizard variable in subsequent flows. Thanks!