Cireson - Portal
Dear All,
I would like to block "Change Status" under tasks for a selected technician account only.
Does anyone have code which can do this?
Kind Regards
Daniel
Best Answers
-
CaterhamITSupport Member Advanced IT Monkey ✭✭✭
I tried using the above code against a username in AD and it doesnt work too.
//Inside Incident form: app.custom.formTasks.add('Incident', null, function (formObj, viewModel) { //bind a function to the form ready event formObj.boundReady(function () { console.log('HideTask script is run...'); console.log('Your user id is: ' + session.user.Id); //Hide task if user id match if(session.user.Id == **** Username ***) //<<----- CHANGE TO MATCH THE USER ID { $('li[data-bind="click: changeStatus"]').hide(); } }); return; });
0 -
Mikkel_Madsen Customer Advanced IT Monkey ✭✭✭
You can also find user id by sql-query
SELECT [Id],[DisplayName],[Analyst] FROM [ServiceManagement].[dbo].[CI$User] Where DisplayName like '%Part of User Displayname%'
5
Answers
If it's just the task when you are in an incident you can do this:
But you have other ways to change status. You can do it in the "send email" task or from tasks in grid view
Thanks for this but how do i find out a session user id code?
I tried using the above code against a username in AD and it doesnt work too.
You can get an userid by email
Change PORTAL to your portal address
Change the YOUR@EMAIL.COM to the email of the user
Look for BaseId in the first line of the result you are getting back
How can I do this if the user is just an AD user and doesn't have an email? I tried and it doesn't work?
Thanks for this help so far by the way:
This is the error:
This XML file does not appear to have any style information associated with it. The document tree is shown below.
<string xmlns="http://schemas.microsoft.com/2003/10/Serialization/"/>
I have managed to get this by adding an address into the mail attribute.
How do i use this code to hide assign to analyst by group?
I have managed to hide the assign analyst by group now.
Thank you for the help Mikkel, really appreciate it.
Kind Regards
Daniel
You can also find user id by sql-query
Dear Mikkel,
I need to hide "Reactivate Incident" for a user too. Can you let me know how to do this?
Thanks
Dan
By F12 you can find the different tasks