Solved

Custom checkbox field value breaks workflow web request

  • 27 February 2023
  • 2 replies
  • 177 views

Badge

TL;DR I have a service catalog item with a checkbox custom field. when i use that custom field as a placeholder in a workflow web request body, the web request body is empty -- why?

 

Hi, I have an automator workflow that's triggered in response to incoming tickets for a particular type of service request.

The corresponding service catalog item has a checkbox field on it, called, say, "Is Checked".

I want a web request node in the automator workflow to post the value of the checkbox back to my application in a webhook. So, using a placeholder for my service catalog item's custom field, I have a web request body that's configured like this:

{

  "other_field": "example",

  "is_checked": {{ticket.ri_123_cf_is_checked}}

}

This workflow works correctly when the checkbox state is true, but when the checkbox value is false it doesn't work -- the body of the web request is empty. See attached image -- the workflow execution logs shows an error and an empty request body.

I can repeatedly reproduce this error, and I tried creating tickets both programmatically and through the UI. I tried changing different settings for the custom checkbox field (is mandatory and show to requesters), but that had no effect. There are other (non-boolean) custom fields on the service catalog item that are used in the body of the request and they’re all working as expected.

Any advice on how to pass the state of this checkbox back to my application via a web request?

 


 

icon

Best answer by Daniel Söderlund 28 February 2023, 08:09

View original

2 replies

Badge

It appears that when the checkbox is unchecked its value is empty instead of `false` -- this seems like a bug since it means the checkbox value can’t be used in downstream workflows.

Userlevel 7
Badge +13

It appears that when the checkbox is unchecked its value is empty instead of `false` -- this seems like a bug since it means the checkbox value can’t be used in downstream workflows.

Ya sound like a bug, I have seen other strange things when fields are empty using the parser.
What I do is to use a expression node and use if(‘{{placeholder}} == ‘’,false,true)

Reply