True/False in reporting to Yes/No

Andrew_TND
Mega Sage
Mega Sage

Good afternoon again!

So, here's my problem.

I have a report which shows SLA's which have breached and this is indicated by a tick box (True/False)

When I report on this management don't like it. Is there a away I can change this to Yes/No? Or any particular work arounds?

The out of the box field is called has_breached

Appreciate it thanks

1 ACCEPTED SOLUTION

Hi Andrew, 

I replicated the same & it gives me data in reports as well.

If it is not working for you, then you can run a background script once & set the before update business rule to update this field.

 

var grSLA = new GlideRecord('task_sla');
grSLA.query();
while(grSLA.next()){
	if(grSLA.has_breached){
		grSLA.u_has_breached_string="Yes"; //set custom field value based on has breached field.
			
	}
	else{
		grSLA.u_has_breached_string="No";
	}
}

Thanks

Gaurav

View solution in original post

8 REPLIES 8

Hi Andrew, 

I replicated the same & it gives me data in reports as well.

If it is not working for you, then you can run a background script once & set the before update business rule to update this field.

 

var grSLA = new GlideRecord('task_sla');
grSLA.query();
while(grSLA.next()){
	if(grSLA.has_breached){
		grSLA.u_has_breached_string="Yes"; //set custom field value based on has breached field.
			
	}
	else{
		grSLA.u_has_breached_string="No";
	}
}

Thanks

Gaurav

Hi

Would it not be easier (I assume) to update the calculated value to use choice 1 or choice 2?

That way they would (In theory) show in reporting.

If that's possible.

Hi Andrew, 

That won't do the trick as its again setting the string value, Please try this through BR & background script to make it scalable & stable one.

 

Andrew_TND
Mega Sage
Mega Sage

Hi thanks for looking into this for me.

This did work but it only worked for SLA's after the date I made the button so I created a UI button to Update all and now we're in business. 

🙂