Ticket can only be closed if it has an owner

Hello everyone,

I am trying to set up a workflow using the RT plugin “MandatoryOnTransition” and I am running into an issue. I would like to ensure that a ticket can only be closed if it has an owner (other than “Nobody”) assigned to it. I am not sure how to set this up using the plugin.

I tried with the following script but with no success…

Set(%MandatoryOnTransition,
    '*' => { 'Owner' => { transition' => 'open -> *', 'group' => ['DutyTeam'] },
);

Has anyone had any experience with this? Any help or advice would be greatly appreciated. Thank you!

Regards

Can you have queue as a wildcard?

according to the documentation yes it is possible

Requiring Any Value
Below is an example which requires 1) time worked and filling in a
custom field named Resolution before resolving tickets in the Helpdesk
queue and 2) a Category selection before resolving tickets in every
other queue.

        Set( %MandatoryOnTransition,
            Helpdesk => {
                '* -> resolved'      => ['TimeWorked', 'CF.Resolution', 'CustomRole.Analyst'],
            },
            '*' => {
                '* -> resolved' => ['CF.Category'],
            },
        );

Looks like that should work then. Do you see something in the logs when trying to close the ticket?

the web server does not respond, it gives a 500 response I have to revert the changes

Oh what do you see in the logs? I assume the config is invalid if the server won’t even start.

Set(%MandatoryOnTransition,
    '*' => { 'Owner' => { transition => 'open -> *', group => ['DutyTeam'] },
);

Probably is invalid because the transition and group string is being considered as a variable but in the documentation it is the same way

syntax error at /opt/rt5/etc/RT_SiteConfig.pm line 117, near “)”
Missing right curly or square bracket at /opt/rt5/etc/RT_SiteConfig.pm line 136, at end of line
Compilation failed in require at /opt/rt5/sbin/…/lib/RT/Config.pm line 2252.

Set(%MandatoryOnTransition,
    '*' => { 'Owner' => { transition => 'open -> *', group => ['DutyTeam'] }, }
);

@knation after correcting the syntax the code above still not worked somehow

it was simply easier with this code:

Set(%MandatoryOnTransition,
    'Incident Reports' => { '* -> resolved' => ['Owner']},
);

probably now through the UI it will no longer be possible to close an incident report without an owner