- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-08-2023 07:59 AM
Hello All,
Hope all are doing fine!!
In change module UI action "implement " when clicked we observed that we were able to move a change to Implement state before the Scheduled Planned Start Date/Time. In actual scenarios, this is not a good practice in terms of ITSM guidelines.
Currently there was no checks for it in the ui action script i modified the script as below now when i click on the ui action nothing happens it wont do anything can anyone advise on this.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-08-2023 09:37 AM
Hi @krishna111 ,
Update UI action "Implement" on change_request table like below.
function moveToImplement() {
g_form.setValue("state", "-1");
gsftSubmit(null, g_form.getFormElement(), "state_model_move_to_implement");
}
if (typeof window == 'undefined')
var pldate=current.start_date;
gs.addInfoMessage(pldate);
var dt=new GlideDateTime();
var plannedDate= new GlideDateTime(pldate);
var diff=plannedDate.getNumericValue()-dt.getNumericValue();
gs.addInfoMessage(diff);
if(diff>0){
gs.addInfoMessage("you can not implement change before start date");
current.setAbortAction(true);
}
else
{
setRedirect();
}
function setRedirect() {
current.update();
action.setRedirectURL(current);
}
Please mark my answer as helpful and correct if it helps to solve your issue.
Regards,
Namrata
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-08-2023 09:37 AM
Hi @krishna111 ,
Update UI action "Implement" on change_request table like below.
function moveToImplement() {
g_form.setValue("state", "-1");
gsftSubmit(null, g_form.getFormElement(), "state_model_move_to_implement");
}
if (typeof window == 'undefined')
var pldate=current.start_date;
gs.addInfoMessage(pldate);
var dt=new GlideDateTime();
var plannedDate= new GlideDateTime(pldate);
var diff=plannedDate.getNumericValue()-dt.getNumericValue();
gs.addInfoMessage(diff);
if(diff>0){
gs.addInfoMessage("you can not implement change before start date");
current.setAbortAction(true);
}
else
{
setRedirect();
}
function setRedirect() {
current.update();
action.setRedirectURL(current);
}
Please mark my answer as helpful and correct if it helps to solve your issue.
Regards,
Namrata
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-08-2023 10:20 AM
Thank you Namrata,It worked like a charm.😀
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-03-2023 08:35 AM
Hi Namrata,
This solution which you provided works for change windows in future but its restricting the changes which are witin the change window.
example : there was a change whose start time in 4.00 am est and end time is 8.00 pm est when tried to implement the change its not allowing to implement on the above mentioned logic..anything which you can see was missed
Thanks in advance
kumar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-03-2023 08:36 AM
Hi @Namrata Ghorpad,
This solution which you provided works for change windows in future but its restricting the changes which are witin the change window.
example : there was a change whose start time in 4.00 am est and end time is 8.00 pm est when tried to implement the change its not allowing to implement on the above mentioned logic..anything which you can see was missed
Thanks in advance
kumar