Jump to content
admin

Wiki: Require Assignee to be a Member of the selected Group

Recommended Posts

I'd like to implement this in our environment but, being VERY new to making customizations in Service Desk I don't know where/how to do this. Can someone add some clarifying material? Thanks.

This is the discussion topic for the wiki article: <A HREF=http://www.servicedeskusers.com/Require_Assignee_to_be_a_Member_of_the_selected_Group>Require Assignee to be a Member of the selected Group</A>

<iframe width="100%" height="300" src="http://www.servicedeskusers.com/Require_Assignee_to_be_a_Member_of_the_selected_Group&action=render"></iframe>

Share this post


Link to post
Share on other sites

You need to create 2 plain text files (e.g., using notepad) in site/mods/majic. The first of these will have the extension mod. I happened to call mine assignee_group_mem.mod but you can call it whatever you want. It's contents should be as I described above but here it is in a code block:

// verify Assignee is a member of the selected Group
MODIFY cr PRE_VALIDATE zcr_assignee_validate(assignee) 140 FILTER ( EVENT ("INSERT UPDATE") );

The second file you will create in site/mods/majic will have the extension spl. I called mine assignee_group_mem.spl

// verify Assignee is a member of the selected Group
cr::zcr_assignee_validate(...)
{
string where_clause, zmsg;
if (!is_null(assignee) && !is_null(group))
{
where_clause = format("group = U'%s' and member = U'%s'", group, assignee);
send_wait(0, top_object(), "call_attr", "grpmem", "sync_fetch", "RLIST_STATIC",where_clause, -1, 0);
if ( msg[1] == 0 )
{
zmsg=format(" Please either change the Group or select an Assignee who is a member of Group %s", group.last_name);
set_error(1);
set_return_data(zmsg);
return;
}
}
}

Of course the lines beginning "//" are comments and the MOD triggers when to invoke the SPL code - in this case, when any record is inserted into or updated into the cr table (request/incident/problem). Whenever you create or change any files in the majic folder, you'll need to recyle services to instantiate the change.

Share this post


Link to post
Share on other sites

Thanks, Lost.

You need to create 2 plain text files (e.g., using notepad) in site/mods/majic. The first of these will have the extension mod. I happened to call mine assignee_group_mem.mod but you can call it whatever you want. It's contents should be as I described above but here it is in a code block:

// verify Assignee is a member of the selected Group
MODIFY cr PRE_VALIDATE zcr_assignee_validate(assignee) 140 FILTER ( EVENT ("INSERT UPDATE") );

The second file you will create in site/mods/majic will have the extension spl. I called mine assignee_group_mem.spl

// verify Assignee is a member of the selected Group
cr::zcr_assignee_validate(...)
{
string where_clause, zmsg;
if (!is_null(assignee) && !is_null(group))
{
where_clause = format("group = U'%s' and member = U'%s'", group, assignee);
send_wait(0, top_object(), "call_attr", "grpmem", "sync_fetch", "RLIST_STATIC",where_clause, -1, 0);
if ( msg[1] == 0 )
{
zmsg=format(" Please either change the Group or select an Assignee who is a member of Group %s", group.last_name);
set_error(1);
set_return_data(zmsg);
return;
}
}
}

Of course the lines beginning "//" are comments and the MOD triggers when to invoke the SPL code - in this case, when any record is inserted into or updated into the cr table (request/incident/problem). Whenever you create or change any files in the majic folder, you'll need to recyle services to instantiate the change.

Share this post


Link to post
Share on other sites

I'm attempting to implement this same requirement. I get the following when I attempt to save ANY type of update to an existing incident.

cr::zcheck_assignee_validate

Here's my spl.

cr::zCheck_assignee_validate(...)

{

string where_clause, zmsg;

if (!is_null(assignee) && !is_null(group))

{

where_clause = format("group = U'%s' and member = U'%s'", group, assignee);

send_wait(0, top_object(), "call_attr", "grpmem", "sync_fetch", "RLIST_STATIC", where_clause, -1, 0);

if ( msg[1] == 0 )

{

zmsg=format(" The Assignee is not a valid member of Group %s", group.last_name);

set_error(1);

set_return_data(zmsg);

return;

}

}

}

Here's my trigger for the cr object.

PRE_VALIDATE zcheck_assignee_validate(assignee) 165 FILTER (EVENT ("INSERT UPDATE"));

Any help would be greatly appreciated! :)

Share this post


Link to post
Share on other sites

I'm very confused and need some help. Per what I'm reading here it seems it's a modification to have the assignee be a member of the selected group. This is what we're seeing as out of box functionality.

We auto populate the assignee field with the calltaker name. If the calltaker selects a group to transfer the ticket to, it takes the assignee name out of the field (assuming that it's because they aren't a member of the group). How is this controlled and how would we allow for any assignee regardless of group?

Thanks!

Share this post


Link to post
Share on other sites

OOTB, SD doesn't prevent non-group members from being selected as Assignee...after you select a Group, if you then do a look-up for Assignee, the user is able to select any Contact you wish, regardless of whether that Contact is group member. Although if assignee isn't a member of the group you are transferring to the contact name is removed, you can just do a look-up and put in whomever you wish, no check for membership. This customization prevents that.

Share this post


Link to post
Share on other sites

Hello,

I implemented this modification in my organisations version of CA Service Desk 11.2

After doing this, 1 person received 1324 notification emails in a 57 minute period. This person had created a new request ticket, and it was assigned to them, but they were not a member of the group assigned. It was possible to save a ticket prior to doing this implementation, due to a default group set in the data partition for request tickets, and the Options Manger setting assignee set being installed.

The 1324 email notifications began, once the request ticket had violated its 12hr resolution service type.

For reasons unknown this sent the single 12hr resolution violation email notification 1324 times. These are the 2 log file error messages that also appeared in parallel with the email notifications:

07/16 08:09:11.22 mohusd01 animator_nxd 7904 ERROR animator_nxd.c 1720 Please either change the Group or select an Assignee who is a member of Group IM1, TS - Service Desk in animator ANI:4925261 (cr:560338) for atev:933207 in method animation_complete

07/16 08:09:18.00 mohusd01 animator_nxd 7904 ERROR animator_nxd.c 1430 Animator ANI:4925261 was skipped; starting it now

I'm assuming it was thinking that it hadn't sent the notification, when it actually had and looped itself.

I frantically went through all my active tickets checking to ensure the assignee was a valid member of the group assigned, and if they weren't manually changing them. Has anyone else experienced this? Or can see from my log file error messages that the modification was the cause of the 1324 email notifications.

If anyone else implements this modification, I would suggest to manually check that all active tickets have a valid assignee.

Stuart

Share this post


Link to post
Share on other sites

  • Announcements

    • Gregg

      Looking for the wiki content?

      12/20/2015

      Until I can transfer the wiki content over to the new Articles, you can find the old content here: http://www.greggsmith.net/wiki.
    • Gregg

      New site logo

      01/06/2016

      A special thanks to brianshs for creating a new site logo!
×