Is it possible to make a report which shows all the tasks without resource plan ?

Fabrice Marian
Tera Contributor

My resource manager would like to see on which tasks he doesn't have add a resource plan. 

How can i do a report or a dashboard to show all the tasks where my manager is responsible without ressource plan ? 

 

1 ACCEPTED SOLUTION

suvro
Mega Sage
Mega Sage

you need to write a script include where you need to GlideRecord the task table and for each task you will have to gliderecord resource plan table and check whether there is any resource plan associated with this task. if yes then continue else add the task number in a array.

At the end return the array

In the filter of the reports you can configure

number is one of ---> javascript: new ScriptInclude().MethodName();

View solution in original post

4 REPLIES 4

suvro
Mega Sage
Mega Sage

you need to write a script include where you need to GlideRecord the task table and for each task you will have to gliderecord resource plan table and check whether there is any resource plan associated with this task. if yes then continue else add the task number in a array.

At the end return the array

In the filter of the reports you can configure

number is one of ---> javascript: new ScriptInclude().MethodName();

Fabrice Marian
Tera Contributor

Thanks suvro but i am not familiar with scripting at all. So I don't know how to do your solution 😞

Create a script include 

create a method inside it

 

getProjects: function (){

var arr = [];

 

var pmPr = new GlideRecord('pm_project');

    pmPr.query();

while (pmPr.next()){

var resP = new GlideRecord('resource_plan');

resP.addQuery('task',  pmPr.sys_id.toString());

resP.query();

if (!resP.next()){

arr.push(pmPr.getValue('number');

}

}

return arr;

},

In the filter of the reports you can configure

number is one of ---> javascript: new <script_include_name>().getProjects();

 

Chris Everding
ServiceNow Employee
ServiceNow Employee

Another option would be to create a new database view like the below - 

find_real_file.png

Replace the project table with whatever table makes sense depending on what tasks you're looking to track. When you open the database view, filter the list based on those tasks you're interested in and then filter out all tasks that are linked to a resource plan to get what you're looking for.

The view won't be useful for much else, I'd be careful around other uses, but given we just want a true or false answer to does the project have one or more resource plans it should work.