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

Creating a filter with script include

vibhor_dwivedi
Mega Expert

Hi all,

 

Creating a filter on 1 of the reports and want to filter Project tasks if top task is of type template.Trying to use script include which is returning the list of sys_ids of projects of type "templates" .On filter set the Top_tasks is not javascript:gs.getTemplateProjects().But It is not filtering the desired tasks.Is there any thing we have to make sure while using the script include functions in filter.I would appreciate any help on this.

 

 

Regards,

1 ACCEPTED SOLUTION

vibhor_dwivedi
Mega Expert

Thanks Anurag and Sebastian, Finally below syntax worked for me.



"Top Task"   "is not" "javascript:getTemplateProjects()"


View solution in original post

3 REPLIES 3

sebastian_g_snc
ServiceNow Employee
ServiceNow Employee

Hi Vibhor.


is getTemplateProjects your script include? I currently don't quite understand your intention. But what I can say is that calling a script include from a reference qualifier (as an example) you use javascript:[your_script_include].


If you wrote a new class in the script include, instantiate it with new [yourscript_include].


Maybe this helps


Anurag Tripathi
Mega Patron
Mega Patron

Hi Vibhor,




I think that you have created a function by the name getTemplateProjects() . so to call this you cant use gs.getTemplateProjects().




on the filter use


<Top Task > <is, contains, is one of, is not> <new YourScripInclude().getTemplateProjects()>




-Anurag


-Anurag

vibhor_dwivedi
Mega Expert

Thanks Anurag and Sebastian, Finally below syntax worked for me.



"Top Task"   "is not" "javascript:getTemplateProjects()"