Paul Hardy
ServiceNow Employee
ServiceNow Employee

The idea was to make the due date fields more visually representative of the urgency.

The due date is auto-populate on requests based on the service selected and we needed a simple and effective way to help the IT support teams see how long they had before the request should be fulfilled.


Think of it as a mini visual SLA!


What we wanted to achieve.

due date colour.PNG


What it would look like for support teams. (taken on 9 May 2013)

sample due dates.png


How we achieved this.


Add styles for each of the following.

Style Green: more than 7 days until due date

  • Table: Task [task]
  • Field: Due Date
  • Style: background-color: #ADFF2F;
  • Value: javascript:current.due_date >= gs.daysAgoStart(-7) && current.state != 3 && current.state != 4

Style Yellow: between 6 and 3 days until due date

  • Table: Task [task]
  • Field: Due Date
  • Style: background-color:#FFFF00;
  • Value: javascript:current.due_date <= gs.daysAgoEnd(-7) && current.due_date > gs.daysAgoStart(-3) && current.state != 3 && current.state != 4

Style Amber: 2 days until due date

  • Table: Task [task]
  • Field: Due Date
  • Style: background-color:#FFBF00;
  • Value: javascript:current.due_date <= gs.daysAgoEnd(-2) && current.due_date > gs.daysAgoStart(-1) && current.state != 3 && current.state != 4

Style Red: due date is today or in the past

  • Table: Task [task]
  • Field: Due Date
  • Style: background-color:#FF0000;
  • Value: javascript:current.due_date <= gs.endOfToday() && current.state != 3 && current.state != 4


Hope this helps!


Until next time...

Paul Hardy

Twitter | LinkedIn


2 Comments