logo

NJP

Give your due dates some style!

Import · May 15, 2014 · article

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.

image

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

image

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

View original source

https://www.servicenow.com/community/united-kingdom-snug/give-your-due-dates-some-style/ba-p/2270685