Agile Board - Filter the backlog on the Sprint Planning tab

John Tomko
Tera Expert

Apologies, I have seen several community posts on this question, but having tried the suggested actions, I am not having any luck.

I want the "Backlog" section of the Sprint Planning Tab on the Agile Board to only show stories that are ready, not blocked, not assigned to a Sprint, and are assigned to the group selected at the top of the board.

In effect, I want this query:

sys_class_name=rm_story^active=true^sprintISEMPTY^stateNOT IN-6,3,4^blocked!=true^assignment_group=[System ID of selected Agile group]

I can modify the UI Macro "sprint_planning", and the changes I make are reflected when I view the board, so I'm pretty confident I am looking at the right thing.  It looks like what I need to modify is on line 55:

{{sp.metadata.backlog.query}}

Of course, I don't want to "hard code" the query.  So, I guess my question is, where does {{sp.metadata.backlog.query}} come from and how do I modify it?

From what I've read, I need to modify function "SdlcList.prototype.updateListFilter" in UI Script SdlcList.  I've tried modifying the query at line 23, but am not seeing any changes to what is displayed.

//OOTB ServiceNow Query
//this.filterQuery = "sys_class_name=rm_story^sprintISEMPTY^state=1^blocked!=true^" + this.pageContext + "=" + this.pageContextId;
		
//Custom Query
this.filterQuery = "sys_class_name=rm_story^active=true^sprintISEMPTY^stateNOT IN-6,3,4^blocked!=true^" + this.pageContext + "=" + this.pageContextId;

I am still seeing the default query.  I added that to the sprint_planning UI Macro so I could verify, and the value for "{{sp.metadata.backlog.query}}" is 

^ORDERBYglobal_rank^sys_class_name=rm_story^active=true^sprintISEMPTY^assignment_group=[Sys ID of selected Agile Group]

(with a valid Sys ID in place of "[Sys ID of selected Agile Group]"

 

For what it's worth, we are on San Diego and Agile Development 2.0

1 ACCEPTED SOLUTION

John Tomko
Tera Expert

I was able to resolve this issue by modifying UI Macro "sprint_planning".  I'm still not certain why the modifications to sdlclist didn't work, and I don't love "hard-coding" a query in an OOTB UI macro, but the following meets my needs:

At line 59, replaced

additional-query="{{sp.additionalQuery}}"

with

additional-query="stateNOT IN-6,3,4^blocked!=true"

View solution in original post

7 REPLIES 7

Yousaf
Giga Sage

Hi John,

I am not sure but Give it a try if you can 

Create a System Property with the value > "Your Query" and call it in place of {sp.metadata.backlog.query}



Mark Correct or Helpful if it helps.


***Mark Correct or Helpful if it helps.***

John Tomko
Tera Expert

I was able to resolve this issue by modifying UI Macro "sprint_planning".  I'm still not certain why the modifications to sdlclist didn't work, and I don't love "hard-coding" a query in an OOTB UI macro, but the following meets my needs:

At line 59, replaced

additional-query="{{sp.additionalQuery}}"

with

additional-query="stateNOT IN-6,3,4^blocked!=true"

thats good although I would suggest saving this in property and call it here. 
hardcoded can make problem when upgrading. 


***Mark Correct or Helpful if it helps.***

Hi @John Tomko ,

I found the correct place where to change the query.

It´s in Script Include AgileBoardMetaDataCommonUtil

 

AgileBoardMetaDataCommonUtil.getBacklogQueryForGroup = function(groupId) {
// Added State=Ready to Backlog filter
	var query = '^sys_class_name=rm_story^active=true^sprintISEMPTY^state=1';
	if(this.isMultiTaskActive())
		query += '^original_task.active=true';
	if(JSUtil.notNil(groupId))
		query += '^assignment_group=' + groupId;
	return query;
};