display number of open Change Tasks

Riaz3
Giga Expert

Hi,

I would like to display a number on the change form which shows the number of open change tasks for that change.

The field will be a String called Open Tasks.

Does anyone know how to do this or has a script which would display this on the Change form?

Thanks

10 REPLIES 10

Indrajit
Mega Guru

Hey Riaz,

You can achieve this by using After Business Rule and write script as below. It shows the number of open change tasks for that change.

var a= new GlideRecord('change_task');
a.addQuery("change_request",current.sys_id);
a.addQuery("state",1);  
a.query();
var b=a.getRowCount();
gs.addInfoMessage("Count:" +b);//here you have to setValue to your open task string field.

Please mark correct and helpful if it works for you.

Regards,

Indrajit.