Skip to main content
Solved

Task worfklow not working properly


jeroen.heijboer
Skilled Expert

Hello all,

I have a workflow based on tasks, the flow is as follows:

However, the action is not executed. When I look at the condition, I have correctly specified the following, in this case, a -1.
 

This is also clearly visible in the task 'Planningstask’ in my ticket:

Does anyone have an idea of what I might be doing wrong?

 

This is want I want with the workflow:

When the task planning has has been completed and if a service item contains any of those words, perform an action.

Best answer by Medic1334

@Daniel Söderlund’s method could work with hard coding the service items but any future service items would have to be added as well if you create new ones. The regex match would be the way to do this and have it be more “future proof” if the root contains I mentioned doesnt work (and would save you an API query).

View original
Did this topic help you find an answer to your question?

7 replies

jeroen.heijboer
Skilled Expert

I see that I create a mistake, I see in my conditions that it checks to 1 task. 

Does somebody knows if I can create an expression like:
“If an service item contains any of these words” 

For now I can only find the option to select service items with secondary fields, only I have a lot of service items where I generally want to filter on words


Medic1334
Skilled Expert
Forum|alt.badge.img+9
  • Skilled Expert
  • 103 replies
  • April 2, 2025

Each service item contains a unique identifier on the name of the field so what you are looking for isnt natively possible.  What you could do is a web request of the ticket, then use a condition on the body.

Here’s an example endpoint that you should be able to copy/paste:

https://{{service_desk_url}}/api/v2/tickets/{{ticket.id_numeric}}/requested_items

 

This will return a list of all the service items on the ticket. Then insert a JSON parser after that step that uses the response body from the web request. After that you should be able to do a condition that is set so the root of the parse contains the value you are looking for.

A good way to test your conditions is to insert notes after each item. This will allow you to “see’ where your conditions arent working while you are building, then once you are done you just delete them and you are good to go.


jeroen.heijboer
Skilled Expert

Thanks ​@Medic1334, only I see that with the verification that I the permission is denied

 

 


Medic1334
Skilled Expert
Forum|alt.badge.img+9
  • Skilled Expert
  • 103 replies
  • April 2, 2025

Did you specify the API credentials to use for this? That or you dont have access to the ticket that is being retrieved or it’s service items. 

We have a service account with the API key saved to our credentials which speeds up development time and ensures if someone leaves the org automators dont break.


Daniel Söderlund
Skilled Expert
Forum|alt.badge.img+14

If you like check if a service item name contains X word you can do some like this 

regexMatch('{{ticket.service_request_item_names}}','word1|word2|word3')

if you just one word to match remove the other and | 
pipe | mean or 

 

Or you can hard code to specific service item 

 


Medic1334
Skilled Expert
Forum|alt.badge.img+9
  • Skilled Expert
  • 103 replies
  • Answer
  • April 2, 2025

@Daniel Söderlund’s method could work with hard coding the service items but any future service items would have to be added as well if you create new ones. The regex match would be the way to do this and have it be more “future proof” if the root contains I mentioned doesnt work (and would save you an API query).


jeroen.heijboer
Skilled Expert

@Medic1334 ​@Daniel Söderlund 

For us I want to trigger the flow when a service item contains example “+1” or “-1”. So when we create new items then we add these too.

So I think I will test the flow with:

regexMatch('{{ticket.service_request_item_names}}','word1|word2|word3')


Reply