Replace Assigned To & Support Group fields with Cireson Assign To Analyst By Group fields in portal
Hello,
I am wanting to replace the Assigned To & Support Group fields in the Incident and Service Request forms on the portal with Cireson Assign To Analyst By Group fields in portal.
I've managed to just disable the default fields and require analysts to use the link in the task pane, however I'm wondering whether anyone has a way to completely replace the fields so that the default form forces you to assign to an analyst from a specific group?
Any help would be appreciated.
Thanks
Best Answers
-
Geoff_Ross Cireson Consultant O.G.Hi Ryan,
You would need to trigger code on the change of support group that took the value of support group selected, and used api/V3/User/GetSupportGroupUsers?id={id} to bring in a list of users in that support Group. Then filter the
Assigned To search box to only those users.
Geoff6 -
Tom_Hendricks Customer Super IT Monkey ✭✭✭✭✭I think this could use some refactoring and would like to add functionality for CR and MA work items when the Support Group customization for those is in place, but here is a scrubbed version of what I have tested on portal 7.2.2016.1.
Note that in my custom.js, I selectively only load this code when the current page is a work item form, so if you see errors on other pages, it may be due to the fact that my code assumes it is running on a ticket form.
Please let me know of any issues or suggestions to enhance it.
7
Answers
You would need to trigger code on the change of support group that took the value of support group selected, and used api/V3/User/GetSupportGroupUsers?id={id} to bring in a list of users in that support Group. Then filter the
Assigned To search box to only those users.
Geoff
Being a KendoUI master (which I am not!) is nearly a prerequisite--the inconsistencies among their controls can be maddening, especially since the controls are wrapped with other elements from Cireson. However, it works spectacularly once everything is referenced correctly. Their API is available online and I suggest keeping it open at all times.
If there is interest, I may be able to share a generic version of the code.
Yes please!
Note that in my custom.js, I selectively only load this code when the current page is a work item form, so if you see errors on other pages, it may be due to the fact that my code assumes it is running on a ticket form.
Please let me know of any issues or suggestions to enhance it.
Thanks heaps for that Tom.
I tried it out on the V7.3 portal and seems to work alright.
Seems to be a little fidgety when you select a support group and it automatically selects the first assignee in the list .. But other than that works well
I look forward to updates to the MA / SR forms in the future if you happen to complete that enhancement.
Thanks
I will send an update after we roll out support groups in the other work items. (Or maybe someone else will make the attempt first?)
Any luck with the "fidget" issues?
My management wants to implement this type of function in the portal. (Too many assigned tickets to specific users but support groups are wrong)
The only stop gap I see right now in implementation is the fact on focus it chooses the first entry and you have to back space it to get the entire membership.
Thanks.
As I mentioned earlier, you can prevent the list from opening on its own (which I believe is what causes the first item to become selected, but I have not tested it in any other manner) by making a couple simple changes:
On lines 20 and 45, change this: var fldAssignee = $("input[name='Assigned'WorkItem']").on("focus", function() { openAssigneeSearch(); });
to this: fldAssignee = $("input[name='Assigned'WorkItem']");
This stops the list from automatically appearing. Our project team wanted that, your users may not. (There are many other ways to guide someone to fill in the field, after all.) The result should be that the list is filtered behind the scenes. I have not tested this in my environment, however.
This was done by copying the Incident.js and and ServiceRequest.js to my CustomSpace folder and makking the following changes:
For anyone not familiar with the .js structure, here is a quick overview.
The files are structured according to the tabs you see on the portal page and this is indicated by the /** TAB **/ comment lines. If you go the the General tab, you will see the structure of the General tab, If you go down to the "columnFieldList" that has the "TierQueue" and "AssignedWorkItem" you can disable the control by adding "Disabled: true" before the closing }.
It will still display in the poral, but you cant select the Support Group or the Analyst. This will force the Analysts to use the "Assign To Analyst By Group" Task and thus ensuring that the correct Support Group is selected for the Assigned Analyst.
I also used this method to disable the affected user and the Title of the IR. (We have sneaky people that change stuff to bypass some procedures...)
Here is what I did with both the Incident.js and ServiceRequest.js files.
Incident.js
ServiceRequest.js
And the end result will look like this:
As you can see the Support Group and the Assigned to has been greyed out and cant be changed. This field will update if the "Assign To Analyst By Group" task is used. I have not noticed any strange behaviour by applying the solution.
Below is a screenshot of the complete form, I have added a custom tab to allow me to change what is displayed for this template. It is still a work in progress...
Ok, that is it, please let me know if I missed something or if you have any other suggestions.
G
This seems easier to fix, and if I am able to devote time to fixing that I will post the fix here. Please feel free to beat me to it, however.
What I would like to happen:
1. An incident is already assigned to a support group and an assigned to user
2. Change the support group and remove the original assigned to user so that a member of the new support group can assign the incident.
currently, the original assigned to user is still assigned if you only choose to reassign the support group.
I used the code I posted above with the screenshots and another one I found in the community...
https://community.cireson.com/discussion/46/assign-to-analyst-by-group
This combination allows me to select a new support group via "Assign to analyst by group" and if I do not select a user in the drop-down, it clears the assigned to user. This will work if the assigned to uses field is populated or not. It also disables the assigned to and support group on the form to force users to use the assign to analyst task.
I use this solution to force the analysts to change the assigned to user when selecting a new support group.
Perhaps there is some other way that it needs to be bound now, but the code simply isn't running other than that very first call when the form loads. Thus far, I have tried 4 different ways of trying to bind to a change event, but none have worked. Not sure what changed here.
Update/Edit: It is not that the change event isn't firing so much as the bindings to the change event are failing. If I bind using this syntax, after the page has loaded and long after boundReady for the form is done, then the code works normally: pageForm.viewModel.bind('change',function () { //do stuff here }, "TierQueue");
So this is apparently a timing and a syntax issue, due to something that has changed in the recent versions.
Edit 2 (am I liveblogging now?): This is beginning to make a little sense. Apparently in the past, it has been possible to cumulatively add event handlers, but not any longer. If I remove all formObj.BoundChange and ...bind('change' fn() {}) calls from my code, then just add one back in. It works. Anything I put in there will run. But if I bind another function to it after, that 2nd function doesn't work.
In my case, I have multiple files that all bind to the same field's change event. Reorganizing these different functions to be called from the same place seems to be the way to get this (and other things) to work, unless a significantly less annoying option presents itself.
This customization broke for us in 9.7.0. in Incident forms, it worked up until 9.6.0 flawlessly for SR's and IR's , but since 9.7.0, this only works for SRs in our test environment :(
Hopefully Cireson will implement this as an OOB feature (for CR,PR and Activity forms as well) soon.
Already voted the thread over here.
Regards,
G.
Edit: Seems to be working again in 9.8.2 for newly created incidents, but for those that were created during 9.7.0 it's seems to be broken. We're still testing it only in our lab environment, so it's safe though, just wanted to give an update
Edit 2: Found the issue which was causing this , in our lab env. we had a few incidents starting with IM (from our old system) and for these it doesn't work, the code works with "IR", sorry for overlooking this :)
Anyone who'd be willing to update the code to also work with Support Groups of Change Requests, Problems & Manual Activities? (https://community.cireson.com/discussion/4963/manual-activity-change-request-and-problem-support-group-lists) 🙏
(Made an Edit to this)
Here is a working version in 10.5.1, please note the following changes:
Hope this helps!