- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-16-2023 11:22 PM
Hi
i have requirement from customer they want ability make closed incident back to resolve state and need to make Additional comment mandatory.
i tired way to achieve this but Additional comment is not visible to ITIL user once the incident is closed so if i make the Additional comment mandatory via ui action from change the state from Close to Resolve its not working.
i created read ACL to provide the access to see once the state change is Close but it didn't work as expected.
Could you please anyone help on this.
Thanks in Advance
Regards
BK
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-23-2023 11:08 PM
Hi All
thanks for reply.
i have able to found the solution for make comments mandatory when state is changed from closed to Resolved
i have created ui action
Name : Reopen incident
Condition: gs.hasRole("itil") && current.state==7
Onclick: commentsDialog();
Action name: reoepn_inc_close
Script:
function commentsDialog() {
var message =g_form.getValue("short_description");
var dialog = new GlideDialogWindow("commmentpage");
dialog.setTitle("Add Comment");
dialog.setSize(750,300);
dialog.setPreference("sysparm_message", message);
dialog.render();
}
Create the ui page;
Name : commmentpage
HTML:
<?xml version="1.0" encoding="utf-8" ?>
<j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null">
<g:ui_form>
<input type="hidden" id="jvar_answer" name="jvar_answer" value=""/>
<input type="hidden" id="contentvalue" name="contentvalue"/>
<input type="hidden" name="cancel_or_submit" id="cancel_or_submit" value=""/>
<textarea id="content" name="content" required="required" value="" />
<g:dialog_buttons_ok_cancel ok_text="${gs.getMessage('OK')}" ok="return actionOK();" cancel="return cancel();"/>
</g:ui_form>
</j:jelly>
Client Script :
function actionOK() {
var comments = gel("content").value;
comments = trim(comments);
alert(comments)
if (comments == "") {
//If comments are empty stop submission
alert("Please provide comments to submit the dialog.");
return false;
}
else
{
gel('jvar_answer').value = g_form.getUniqueValue();
gel('contentvalue').value = gel('content').value;
}
}
function cancel() {
GlideDialogWindow.get().destroy();
return false; //Close the dialog window
}
Process Script :
var app = new GlideRecord("incident");
if (app.get(this.jvar_answer)) {
app.comments= this.contentvalue;
app.state=6;
app.update();
response.sendRedirect(app.getLink(false))
}
Thanks,
BK
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-17-2023 12:59 AM
Hi @Bhavya11 ,
If it is not visible for ITIL, why do we make them mandatory?
For that requirement, You can create a UI policy/ client script (On submit) to achieve it.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-17-2023 02:07 AM
hi @Bhavya11
How you have allowed user to change state from closed to resolved ??
Once I have deactivated the flow : Resolve blocked by record if Incident is closed and UI Policy :Make fields read-only on close. I am getting the worknote and additional comment visible.
- Check your Client Scripts to see if this field is mentioned in any script where if the state if Closed, to setVisible or setDisplay is false, meaning it's hiding it.
Please mark the response helpful and accept it as solution
Thanks
Akash
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-17-2023 02:43 AM
Hi @Community Alums
i have checked all Client script and UI policy but didn't get any luck on that. so i have tired the using UI page and copy the comment to incident table after submitting ok (below screenshot for reference) but its not working for ITIL user only works for Admin.
Regards,
BK

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-17-2023 03:03 AM
hi @Bhavya11
You need to check the ACL as it can be most probable reason the field is not coming up for ITIL user while it is coming for Admin user.
Please mark the response helpful and accept it as solution
Thanks
Akash