Is there a way to remove the requirement of adding a solution when closing a user request? I got that question from my manager to look into. Maybe just to add a button to "Resolve without adding solution" or to just close the ticket without the box for solution even appearing?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Yes, you can customize all the fields (and transitions and much more) in iTop. For that however, you usually need to create an extension to customize the datamodel.
There's some really good documentation by Combodo. And some official examples; but there's a lot more in this repository too on how to accomplish certain things.
Am I on the right track if I need to create an extension that includes a js that will override the "Mark as resolved" button ? If so, is this the correct way to include the JS in the module php?
'js' => array(
'disable_solution_popup.js',
),
I've also in the datamodel xml entered this in order to make the solution not mandatory:
I now got the JS to load.. I found the "class XXX implements \iBackofficeReadyScriptExtension".. which made things work as it should.
I now just have to make the JS work properly to actually close the ticket. I did a test using a API post, but that requires authenticion of course, and I'm not sure it's a good idea to include a token in the code? Or is there any way to close the ticket without using API?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi Jeffrey!
I saw your example (see below) on how you did it. But I can't seem to get past the setup of the extension as you see. It fails no matter what I do :( Can you maybe help me?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I was thinking that maybe it could be another checkbox beside "Notify" for closing the ticket directly from the public log entry. But I see now that send and marked as resolved is better to use :) So nevermind... If I solve an extension to not require solotion this is the way to go :)
If your strategy is to totally remove the prompting of additional info when closing a UserRequest, you just need to remove this field from the flag within the UserRequest lifecycle in the ev_resolve transition, this is pure XML and does not requires to write any JS
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I get this error when installing the extension:
/itop_design/class[UserRequest]/lifecycle/states/state[assigned]/transitions/transition[ev_resolve] at line 13: could not be found or marked as removed
Any input on what could be wrong?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
If I look inte network - doc when I resolve a request I see this call is made:
<urltoitop>/pages/UI.php?stimulus=ev_resolve&class=UserRequest&operation=stimulus&id=386</urltoitop>
So It seems that it actually uses the ev_resolve on the class. So is there maybe something wrong in my XML?
Sorry I have not tested my XML, check the raw datamodel XML files to see how it is truly defined by default and how to change it. I use to do it in a few clicks in the ITSM Designer so, I never remember by heart how to do it in pure XML...
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Error loading module "jnit-disablesolution": /itop_design/class[UserRequest]/lifecycle/states/state[resolved]/flags/attribute[solution]/mandatory at line 11: could not be deleted (not found)
So it seems not to find it ?
Last edit: Niclas Eriksson 2025-01-20
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
2 options, either you are not running in full ITIL (2 different classes for Incident and UserRequest) or some other customization has already changed this.
replace your "delete" by a "delete_if_exists"
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
In the config I use "ITIL Compliant Ticket Management" and have ticked "User Request mgmt", "Incidient Mgmt" and "Customer portal".
I'll look into if I see any other config file/extension to find coliding configs..
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Error loading module "itop-request-mgmt-itil": /class[UserRequest] at line 4 could not be added : already exists in `/itop_design/classes/class[UserRequest]
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Seems to me that the two extensions don't like each other? :)
Should I maybe add some delta on the <class id="UserRequest" _delta=xxxx in my extension to make it not colide?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Error loading module "itop-request-mgmt-itil": /class[UserRequest] at line 4 could not be added : already exists in /itop_design/classes/class[UserRequest] created_in: [jnit-disablesolution] at line 4
So it seems that my new extension is making the original one to fail.
So then I tried to add: <class id="UserRequest" _delta="must_exist">
But then the error is:
Error loading module "jnit-disablesolution": /itop_design/classes/class[UserRequest] at line 4: could not be found or marked as removed
I'm a bit lost now... What am I doing wrong?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Is there a way to remove the requirement of adding a solution when closing a user request? I got that question from my manager to look into. Maybe just to add a button to "Resolve without adding solution" or to just close the ticket without the box for solution even appearing?
It would also be great if there is a way to close a ticket directly from the public log, like the checkbox for "Notify" or similar.
I also hated that :)
Yes, you can customize all the fields (and transitions and much more) in iTop. For that however, you usually need to create an extension to customize the datamodel.
There's some really good documentation by Combodo. And some official examples; but there's a lot more in this repository too on how to accomplish certain things.
Most useful resources are:
https://www.itophub.io/wiki/page?id=latest:customization:xml_reference
https://www.itophub.io/wiki/page?id=latest:customization:datamodel#content_of_a_module
https://www.itophub.io/wiki/page?id=latest:customization:portal_xml
Or, reach out to someone.
--
Where do you mean exactly? As you can enter a new public log; and then just use 'send and mark as resolved'?
Am I on the right track if I need to create an extension that includes a js that will override the "Mark as resolved" button ? If so, is this the correct way to include the JS in the module php?
I've also in the datamodel xml entered this in order to make the solution not mandatory:
I have a JS that contains this :
But it doesn't seem to load the JS file at all if I reload the page and look into F12-Network.
I now got the JS to load.. I found the "class XXX implements \iBackofficeReadyScriptExtension".. which made things work as it should.
I now just have to make the JS work properly to actually close the ticket. I did a test using a API post, but that requires authenticion of course, and I'm not sure it's a good idea to include a token in the code? Or is there any way to close the ticket without using API?
Hi Jeffrey!
I saw your example (see below) on how you did it. But I can't seem to get past the setup of the extension as you see. It fails no matter what I do :( Can you maybe help me?
OK thanks, that was expected.. I'll look into creating a new extension for it :)
I was thinking that maybe it could be another checkbox beside "Notify" for closing the ticket directly from the public log entry. But I see now that send and marked as resolved is better to use :) So nevermind... If I solve an extension to not require solotion this is the way to go :)
If your strategy is to totally remove the prompting of additional info when closing a UserRequest, you just need to remove this field from the flag within the UserRequest lifecycle in the ev_resolve transition, this is pure XML and does not requires to write any JS
Thats sound great! I'm not sure how to remove that though, could you tell me how?
Here is the tuto to make a field mandatory in a transition, to do the opposite, you more or less need to remove that XML branch with a delta="delete"
There could be more transition from other starting state where you want to remove this
This seems far easier :) I'll try this out.. Thanks!
I get this error when installing the extension:
/itop_design/class[UserRequest]/lifecycle/states/state[assigned]/transitions/transition[ev_resolve] at line 13: could not be found or marked as removed
Any input on what could be wrong?
If I look under Datamodel - UserRequest and "States and Transitions" I see this:
Resolved (resolved)
- Close this request (ev_close) -> Closed (closed) (SetCurrentDate(attcode:close_date))
- Re-open (ev_reopen) -> Assigned (assigned)
Automatic resolve (ev_autoresolve) - > Resolved (resolved),SetCurrentDate(attcode:resolution_date), SetElapsedTime(attcode:time_spent, attcode:start_date, string:DefaultWorkingTimeComputer), ResolveChildTickets())
I don't see the "ev_resolve" ?
I've tried to use "ev_close" instead, but no luck with that either.
Last edit: Niclas Eriksson 2025-01-17
Ignore this.. I looked at the wrong state, it's in the Assigned state of course.. :)
If I look inte network - doc when I resolve a request I see this call is made:
<urltoitop>/pages/UI.php?stimulus=ev_resolve&class=UserRequest&operation=stimulus&id=386</urltoitop>
So It seems that it actually uses the ev_resolve on the class. So is there maybe something wrong in my XML?
Sorry I have not tested my XML, check the raw datamodel XML files to see how it is truly defined by default and how to change it. I use to do it in a few clicks in the ITSM Designer so, I never remember by heart how to do it in pure XML...
So in the datamodel.itop-request-mgmt-itil.xml I see this config regarding "solution":
Under the state "assigned":
So no relation to Solution what I can see.
Then under the state "resolved":
So what I've done was to look at the example from Jeffrey and added this into my Extension:
But that results in this error during setup:
Error loading module "jnit-disablesolution": /itop_design/class[UserRequest]/lifecycle/states/state[resolved]/flags/attribute[solution]/mandatory at line 11: could not be deleted (not found)
So it seems not to find it ?
Last edit: Niclas Eriksson 2025-01-20
2 options, either you are not running in full ITIL (2 different classes for Incident and UserRequest) or some other customization has already changed this.
replace your "delete" by a "delete_if_exists"
In the config I use "ITIL Compliant Ticket Management" and have ticked "User Request mgmt", "Incidient Mgmt" and "Customer portal".
I'll look into if I see any other config file/extension to find coliding configs..
The only thing I find is that we use the extension "Dispatch to team" with this config but that shouldn't interfere, correct?
But now I actually get another error..
Error loading module "itop-request-mgmt-itil":
/class[UserRequest]
at line 4 could not be added : already exists in `/itop_design/classes/class[UserRequest]Forget this.. I added a <parent>Ticket</parent> when testing to see if that matter, that is now removed. So this how it looks now.
Seems to me that the two extensions don't like each other? :)
Should I maybe add some delta on the <class id="UserRequest" _delta=xxxx in my extension to make it not colide?
OK, could someon please help. This is how my extension looks like right now:
And if I try to install it I get this error:
So it seems that my new extension is making the original one to fail.
So then I tried to add:
<class id="UserRequest" _delta="must_exist">
But then the error is:
I'm a bit lost now... What am I doing wrong?