Creating a UI action form link or button on the change form?

Ub11
Mega Expert

On creating a change an assessment is added in the related list. If you open the assessment a command on the form appears UI Action: Take assessment

find_real_file.png

How can i create another UI action from the change_request to achieve the same. So a command button or form link that can take me directly to the available assessment for the change, without needing to go into the related list?

Please advise.

3 REPLIES 3

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

Assessments are to be meant to be taken from this table only

why to have UI action on change request table?

Regards
Ankur

 

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

Just to save on few clicks for the user, so that he can simply trigger the assessment from where he is in the change form.

 

Upon submitting the change a customised Info Message comes up generated by a business rule;

------------

(function executeRule(current, previous /*null when async*/) {

var typeID = gs.getProperty('si.change_request.risk_impact.metric_type'); //Change Requests metric type

var assessmentHelper = new SIAssessmentHelper();
assessmentHelper.createChangeAssessments(typeID, current);


action.setRedirectURL(current);

var asmt = new GlideRecord('asmt_assessment_instance');
asmt.addQuery('u_task', current.sys_id);
asmt.addQuery('user', gs.getUserID());
asmt.addQuery('state', 'ready').addOrCondition('state', 'wip');
asmt.query();

if(asmt.next()){

var url = '/assessment_take2.do?sysparm_assessable_sysid=' + asmt.sys_id.toString() + '&sysparm_assessable_type=' + asmt.metric_type.toString();
gs.addInfoMessage("<span><font size=4><a href= '" + url + "'>Assessments have now been generated. You can view your outstanding assessments in the related list at the bottom of this form or click here to fill out now.</a></font></span>");

}
else{

gs.addInfoMessage('Assessments have now been generated. You can view your outstanding assessments in the related list at the bottom of this form.');

}

})(current, previous);

--------

which allows user to go directly to the 'Take Assessment', however that disappears upon change of form, so when user return to the change they are required to go into the related list then click on the assessment,then click take assessment, so not very intuitive.

Where as if a form link or Button existed direct from change to go straight to take assessment that would be easier.