Visibility of Complete button
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-21-2023 12:13 AM
Hi Developers,
I want the Complete button to visible on problem form when problem ticket completes 45 days from the time it was resolved. Problem Resolved Date & Time comes under the field name FIX (fix_at).
I have looked the UI Action button configuration but could not find a suitable solution.
Share you thoughts that how to tackle this.
Thanks in advance.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-21-2023 12:37 AM - edited 06-21-2023 12:37 AM
- Create a script include with a function which check the dates and returns true/false
- Add the script include call in the UI Action condition field with "javascript" prefix
like this: javascript:(new AssetUtils).canConsume(current)
I will always try to give a meaningful and valid answer.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-21-2023 12:52 AM - edited 06-21-2023 12:53 AM
Hi @Saurabh _ ,
Hope you are doing good
Please follow the below steps-
1. Create a script include -
var ProblemCompleteButton = Class.create();
ProblemCompleteButton.prototype = {
initialize: function() {
},
canComplete : function () {
var current_date = new GlideDateTime().getDisplayValue();
var resolved_at = new GlideDateTime(current.sys_created_on).getDisplayValue();
var dateDiff =gs.dateDiff(resolved_at,current_date,false);
if(dateDiff.split(" ")[0]>40){
return true;
}
else {
return false;
}
}
};
Create UI action - With condition
Javascript: new ProblemCompleteButton().canComplete()
Please mark this response as correct or helpful if it assisted you with your question.
Regards,
Harshal
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-28-2025 05:11 AM
Hi @Harshal Aditya & @Guido Bernuetz!!
I have similar kind of requirement.
The Complete button to visible on Resolved problem form for a specific 'XYZ' team & once clicked, it moves the problem ticket to the Closed state.
Kindly share your thoughts.
TIA
Hiranmayee