Request Types With Behaviours

Problem

Users often try to filter on Service Desk Request Types directly within a script by trying to get at the Request Type field from the create/edit or transition form with Scriptrunner behaviours. This field does not exist on the service desk portal so it is not possible from directly inside the script.

Solution

The problem with Request types in the Service desk portal is you cannot get the Request type value from a field because the screen where our behaviours run does not have the request type field, it has a HTML header tag with the request type name that sits at the top of the form.


Although you cannot get at the Request type as a field within a script we do have a method that can be used to target Request Types and trigger specific behaviours.

If you look at the URL when you choose a Request Type you can see that a different number is appended to the URL when you choose them.


e.g: if I choose another Request type on the previous screen I see a different number:


We took this into consideration when we created the ability to use Behaviours on the Service Desk.

This design does, however, mean that triggering behaviours for specific request type(s) has to be done through the Mappings you define when creating the behaviour because we essentially look at the request type id's and match them in the URL so we then load the correct behaviours.


So, in summary, you have to use the mapping feature as shown below, in order to Map certain behaviours to specific request Types: