The CreatorCon Call for Content is officially open! Get started here.

Active Projects with no Activity Task and not in Draft activity phase

Vittanala Siva
Tera Contributor

in the activity table I need a report for Active Projects with no Activity Task and not in Draft activity phase

2 REPLIES 2

Ankur Bawiskar
Tera Patron
Tera Patron

@Vittanala Siva  

is this for project management module?

if yes then you can use classless script include and call it in report filter conditio

SysId [IS ONE OF] javascript: getProjects()

function getProjects() {
    var projectSysIdArray = [];
    var gr = new GlideRecord('pm_project'); // Query the Project table
    gr.addActiveQuery();
    gr.addQuery('activity_phase', '!=', 'draft'); // Exclude projects in the Draft phase
    gr.query();
    while (gr.next()) {
        var ptask = new GlideRecord('pm_project_task');
        ptask.addQuery('project', gr.sys_id);
        ptask.setLimit(1);
        ptask.query();
        if (!ptask.hasNext())
            projectSysIdArray.push(gr.getUniqueValue());
    }
    return projectSysIdArray.toString();
}

If my response helped please mark it correct and close the thread so that it benefits future readers.

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

@Vittanala Siva  

something like this using filter condition and related list condition

AnkurBawiskar_0-1734961710024.pngAnkurBawiskar_1-1734961723952.png

 

If my response helped please mark it correct and close the thread so that it benefits future readers.

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