<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question Re: Changing Field Style for Problem Tasks if due date is passed in ITSM forum</title>
    <link>https://www.servicenow.com/community/itsm-forum/changing-field-style-for-problem-tasks-if-due-date-is-passed/m-p/457313#M29092</link>
    <description>&lt;P&gt;Hi Joe&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can you try changing value to this format. Please ignore if you already tried it&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE class="language-markup"&gt;&lt;CODE&gt;javascript: var answer = gs.dateDiff(current.due_date.getDisplayValue(),gs.nowDateTime(),true) &amp;lt;  0; answer;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks&lt;/P&gt;</description>
    <pubDate>Thu, 12 Mar 2020 15:44:39 GMT</pubDate>
    <dc:creator>Ashok Katam</dc:creator>
    <dc:date>2020-03-12T15:44:39Z</dc:date>
    <item>
      <title>Changing Field Style for Problem Tasks if due date is passed</title>
      <link>https://www.servicenow.com/community/itsm-forum/changing-field-style-for-problem-tasks-if-due-date-is-passed/m-p/457312#M29091</link>
      <description>&lt;P&gt;I'm trying to change the font color of the due dates in the list view of PTASKS if the due date is past, but no matter what I try it doesn't seem to work.&lt;/P&gt;
&lt;P&gt;Here's what I have now:&lt;/P&gt;
&lt;P&gt;Table: Problem Task [problem_task]&lt;/P&gt;
&lt;P&gt;Field Name: Due date&lt;/P&gt;
&lt;P&gt;Value:&amp;nbsp;javascript:gs.dateDiff(current.due_date.getDisplayValue(),gs.nowDateTime(),true) &amp;lt;&amp;nbsp; 0 ;&lt;/P&gt;
&lt;P&gt;Style:&amp;nbsp;&amp;nbsp;color:red;&lt;/P&gt;
&lt;P&gt;What am I doing wrong?&lt;/P&gt;
&lt;P&gt;Also, where can if find a comprehensive list of styles&amp;nbsp; (colors, background, font sizes, etc.) ?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 12 Mar 2020 15:22:23 GMT</pubDate>
      <guid>https://www.servicenow.com/community/itsm-forum/changing-field-style-for-problem-tasks-if-due-date-is-passed/m-p/457312#M29091</guid>
      <dc:creator>Joe Taylor</dc:creator>
      <dc:date>2020-03-12T15:22:23Z</dc:date>
    </item>
    <item>
      <title>Re: Changing Field Style for Problem Tasks if due date is passed</title>
      <link>https://www.servicenow.com/community/itsm-forum/changing-field-style-for-problem-tasks-if-due-date-is-passed/m-p/457313#M29092</link>
      <description>&lt;P&gt;Hi Joe&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can you try changing value to this format. Please ignore if you already tried it&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE class="language-markup"&gt;&lt;CODE&gt;javascript: var answer = gs.dateDiff(current.due_date.getDisplayValue(),gs.nowDateTime(),true) &amp;lt;  0; answer;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Thu, 12 Mar 2020 15:44:39 GMT</pubDate>
      <guid>https://www.servicenow.com/community/itsm-forum/changing-field-style-for-problem-tasks-if-due-date-is-passed/m-p/457313#M29092</guid>
      <dc:creator>Ashok Katam</dc:creator>
      <dc:date>2020-03-12T15:44:39Z</dc:date>
    </item>
    <item>
      <title>Re: Changing Field Style for Problem Tasks if due date is passed</title>
      <link>https://www.servicenow.com/community/itsm-forum/changing-field-style-for-problem-tasks-if-due-date-is-passed/m-p/457314#M29093</link>
      <description>&lt;P&gt;Thanks for the suggestion.&amp;nbsp; This didn't work either.&amp;nbsp; I think my issue is more fundamental.&amp;nbsp; I tried just changing the value to just "true" to see if my style rule was even getting applied.&amp;nbsp; This didn't work either.&amp;nbsp; So I must be missing something basic to make the style rules active or something.&lt;/P&gt;</description>
      <pubDate>Thu, 12 Mar 2020 16:45:52 GMT</pubDate>
      <guid>https://www.servicenow.com/community/itsm-forum/changing-field-style-for-problem-tasks-if-due-date-is-passed/m-p/457314#M29093</guid>
      <dc:creator>Joe Taylor</dc:creator>
      <dc:date>2020-03-12T16:45:52Z</dc:date>
    </item>
    <item>
      <title>Re: Changing Field Style for Problem Tasks if due date is passed</title>
      <link>https://www.servicenow.com/community/itsm-forum/changing-field-style-for-problem-tasks-if-due-date-is-passed/m-p/457315#M29094</link>
      <description>&lt;P&gt;Use this Value-&lt;/P&gt;
&lt;PRE class="language-javascript"&gt;&lt;CODE&gt;javascript: var answer = (current.due_date.getDisplayValue() &amp;lt;= (new GlideDateTime().getDisplayValueInternal())); answer;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I tested it works.&lt;/P&gt;
&lt;P&gt;I usually check all exisiting style shees for reference and some you need to try if not already used in system.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;-Tanaji&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;Please mark response correct/helpful if applicable&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 12 Mar 2020 17:40:30 GMT</pubDate>
      <guid>https://www.servicenow.com/community/itsm-forum/changing-field-style-for-problem-tasks-if-due-date-is-passed/m-p/457315#M29094</guid>
      <dc:creator>Tanaji Patil</dc:creator>
      <dc:date>2020-03-12T17:40:30Z</dc:date>
    </item>
    <item>
      <title>Re: Changing Field Style for Problem Tasks if due date is passed</title>
      <link>https://www.servicenow.com/community/itsm-forum/changing-field-style-for-problem-tasks-if-due-date-is-passed/m-p/457316#M29095</link>
      <description>&lt;P&gt;I have stopped trying to figure out the Jave script logic, because I can't even get ANY new style definition to work.&lt;/P&gt;
&lt;P&gt;As an experiment, I tried the simplest one I could think of.&lt;/P&gt;
&lt;P&gt;This should just turn the font for the State column red on every Problem ticket if it's "Open".&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Table: Problem&lt;/P&gt;
&lt;P&gt;Field Name: State&lt;/P&gt;
&lt;P&gt;Value: Open&lt;/P&gt;
&lt;P&gt;color:red;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This doesn't work!&amp;nbsp; &amp;nbsp;What am I missing?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 12 Mar 2020 19:45:24 GMT</pubDate>
      <guid>https://www.servicenow.com/community/itsm-forum/changing-field-style-for-problem-tasks-if-due-date-is-passed/m-p/457316#M29095</guid>
      <dc:creator>Joe Taylor</dc:creator>
      <dc:date>2020-03-12T19:45:24Z</dc:date>
    </item>
    <item>
      <title>Re: Changing Field Style for Problem Tasks if due date is passed</title>
      <link>https://www.servicenow.com/community/itsm-forum/changing-field-style-for-problem-tasks-if-due-date-is-passed/m-p/457317#M29096</link>
      <description>&lt;P&gt;Open is the label and not backed value. Put backed value in value field (should be number value) and try.&lt;/P&gt;
&lt;P&gt;-Tanaji&lt;BR /&gt;&lt;EM&gt;&lt;STRONG&gt;Please mark response correct/helpful if applicable&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 12 Mar 2020 19:48:06 GMT</pubDate>
      <guid>https://www.servicenow.com/community/itsm-forum/changing-field-style-for-problem-tasks-if-due-date-is-passed/m-p/457317#M29096</guid>
      <dc:creator>Tanaji Patil</dc:creator>
      <dc:date>2020-03-12T19:48:06Z</dc:date>
    </item>
    <item>
      <title>Re: Changing Field Style for Problem Tasks if due date is passed</title>
      <link>https://www.servicenow.com/community/itsm-forum/changing-field-style-for-problem-tasks-if-due-date-is-passed/m-p/457318#M29097</link>
      <description>&lt;P&gt;Ah - Very good!&amp;nbsp; This is now the behavior I'm looking for.&lt;/P&gt;
&lt;P&gt;When I set the state value to '1' instead of 'open', the state field shows up red in the list view now and not the form view.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;However, this just solved my experiment only.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm still looking for an answer to my original question which is why my javascript for determining if a PTASK is overdue isn't working.&lt;/P&gt;
&lt;P&gt;I've tried 3 different things:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp;javascript:gs.dateDiff(current.due_date.getDisplayValue(),gs.nowDateTime(),true) &amp;lt; 0 ;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp;javascript: var answer =&amp;nbsp; &amp;nbsp; gs.dateDiff(current.due_date.getDisplayValue(),gs.nowDateTime(),true) &amp;lt; 0; answer;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;&amp;nbsp; &amp;nbsp;javascript: var answer = (current.due_date.getDisplayValue() &amp;lt;= (new&amp;nbsp; &amp;nbsp;GlideDateTime().getDisplayValueInternal())); answer;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;None of these work.&lt;/P&gt;</description>
      <pubDate>Thu, 12 Mar 2020 20:13:43 GMT</pubDate>
      <guid>https://www.servicenow.com/community/itsm-forum/changing-field-style-for-problem-tasks-if-due-date-is-passed/m-p/457318#M29097</guid>
      <dc:creator>Joe Taylor</dc:creator>
      <dc:date>2020-03-12T20:13:43Z</dc:date>
    </item>
    <item>
      <title>Re: Changing Field Style for Problem Tasks if due date is passed</title>
      <link>https://www.servicenow.com/community/itsm-forum/changing-field-style-for-problem-tasks-if-due-date-is-passed/m-p/457319#M29098</link>
      <description>&lt;P&gt;So right now this is working on the list view if I'm actually in the Problem ticket itself.&lt;/P&gt;
&lt;P&gt;(See 2nd screenshot)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Table: Problem Task&lt;/P&gt;
&lt;P&gt;Field Name: Due Date&lt;/P&gt;
&lt;P&gt;Value:javascript: var answer = (current.due_date.getDisplayValue() &amp;lt;= (new GlideDateTime().getDisplayValueInternal())); answer;&lt;/P&gt;
&lt;P&gt;Style: background-color: red&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;However, I'd like this format to show up when I'm in the "Tasks" List view as well.&lt;/P&gt;
&lt;P&gt;(1st Screenshot)&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="find_real_file.png"&gt;&lt;img src="https://www.servicenow.com/community/image/serverpage/image-id/24170iE3BE85CB6C3033C2/image-size/large?v=v2&amp;amp;px=999" role="button" title="find_real_file.png" alt="find_real_file.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="find_real_file.png"&gt;&lt;img src="https://www.servicenow.com/community/image/serverpage/image-id/24171iCB377FB00878A5EE/image-size/large?v=v2&amp;amp;px=999" role="button" title="find_real_file.png" alt="find_real_file.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 12 Mar 2020 21:00:17 GMT</pubDate>
      <guid>https://www.servicenow.com/community/itsm-forum/changing-field-style-for-problem-tasks-if-due-date-is-passed/m-p/457319#M29098</guid>
      <dc:creator>Joe Taylor</dc:creator>
      <dc:date>2020-03-12T21:00:17Z</dc:date>
    </item>
    <item>
      <title>Re: Changing Field Style for Problem Tasks if due date is passed</title>
      <link>https://www.servicenow.com/community/itsm-forum/changing-field-style-for-problem-tasks-if-due-date-is-passed/m-p/457320#M29099</link>
      <description>You’d need to add the same field style to the task table and include current.sys_class_name == ‘problem_task’</description>
      <pubDate>Fri, 13 Mar 2020 00:15:10 GMT</pubDate>
      <guid>https://www.servicenow.com/community/itsm-forum/changing-field-style-for-problem-tasks-if-due-date-is-passed/m-p/457320#M29099</guid>
      <dc:creator>The Machine</dc:creator>
      <dc:date>2020-03-13T00:15:10Z</dc:date>
    </item>
    <item>
      <title>Re: Changing Field Style for Problem Tasks if due date is passed</title>
      <link>https://www.servicenow.com/community/itsm-forum/changing-field-style-for-problem-tasks-if-due-date-is-passed/m-p/457321#M29100</link>
      <description>&lt;P&gt;Where do I include this?&amp;nbsp; In the Value window?&amp;nbsp; Like this?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;javascript: var answer = (current.due_date.getDisplayValue() &amp;lt;= (new GlideDateTime().getDisplayValueInternal())); answer; current.sys_class_name == 'problem_task';&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 13 Mar 2020 12:48:49 GMT</pubDate>
      <guid>https://www.servicenow.com/community/itsm-forum/changing-field-style-for-problem-tasks-if-due-date-is-passed/m-p/457321#M29100</guid>
      <dc:creator>Joe Taylor</dc:creator>
      <dc:date>2020-03-13T12:48:49Z</dc:date>
    </item>
    <item>
      <title>Re: Changing Field Style for Problem Tasks if due date is passed</title>
      <link>https://www.servicenow.com/community/itsm-forum/changing-field-style-for-problem-tasks-if-due-date-is-passed/m-p/457322#M29101</link>
      <description>&lt;P&gt;Hi MB.&amp;nbsp; Any guidance for my last question?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 18 Mar 2020 15:15:08 GMT</pubDate>
      <guid>https://www.servicenow.com/community/itsm-forum/changing-field-style-for-problem-tasks-if-due-date-is-passed/m-p/457322#M29101</guid>
      <dc:creator>Joe Taylor</dc:creator>
      <dc:date>2020-03-18T15:15:08Z</dc:date>
    </item>
    <item>
      <title>Re: Changing Field Style for Problem Tasks if due date is passed</title>
      <link>https://www.servicenow.com/community/itsm-forum/changing-field-style-for-problem-tasks-if-due-date-is-passed/m-p/457323#M29102</link>
      <description>&lt;P&gt;Open the same style sheet which you created for problem_task table &amp;gt;&amp;gt; change the table to Task [task] &amp;gt;&amp;gt; insert and stay. With this you will have a copy of this style for task table.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;-Tanaji&lt;BR /&gt;&lt;EM&gt;&lt;STRONG&gt;Please mark response correct/helpful if applicable&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 18 Mar 2020 16:14:06 GMT</pubDate>
      <guid>https://www.servicenow.com/community/itsm-forum/changing-field-style-for-problem-tasks-if-due-date-is-passed/m-p/457323#M29102</guid>
      <dc:creator>Tanaji Patil</dc:creator>
      <dc:date>2020-03-18T16:14:06Z</dc:date>
    </item>
    <item>
      <title>Re: Changing Field Style for Problem Tasks if due date is passed</title>
      <link>https://www.servicenow.com/community/itsm-forum/changing-field-style-for-problem-tasks-if-due-date-is-passed/m-p/457324#M29103</link>
      <description>&lt;P&gt;In case you only want it to be only for problem_task record (but visible on task and problem_task) then ignore my previous comment and update the existing style which you have on problem_task table to look like this-&lt;/P&gt;
&lt;P&gt;Table: Task [task]&lt;BR /&gt;Field name: Due date&lt;BR /&gt;Value:&lt;/P&gt;
&lt;PRE class="language-javascript"&gt;&lt;CODE&gt;javascript: var answer = (current.due_date.getDisplayValue() &amp;lt;= (new GlideDateTime().getDisplayValueInternal())) &amp;amp;&amp;amp; current.sys_class_name == 'problem_task'; answer;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;BR /&gt;Style: background-color: red&lt;/P&gt;
&lt;P&gt;-Tanaji&lt;BR /&gt;&lt;STRONG&gt;&lt;EM&gt;Please mark response correct/helpful if applicable&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 18 Mar 2020 16:23:33 GMT</pubDate>
      <guid>https://www.servicenow.com/community/itsm-forum/changing-field-style-for-problem-tasks-if-due-date-is-passed/m-p/457324#M29103</guid>
      <dc:creator>Tanaji Patil</dc:creator>
      <dc:date>2020-03-18T16:23:33Z</dc:date>
    </item>
    <item>
      <title>Re: Changing Field Style for Problem Tasks if due date is passed</title>
      <link>https://www.servicenow.com/community/itsm-forum/changing-field-style-for-problem-tasks-if-due-date-is-passed/m-p/457325#M29104</link>
      <description>&lt;P&gt;Sorry about that.&amp;nbsp; Don't know how I missed that update.&amp;nbsp; Tanaji's answer below should do the trick for you.&lt;/P&gt;</description>
      <pubDate>Wed, 18 Mar 2020 18:41:19 GMT</pubDate>
      <guid>https://www.servicenow.com/community/itsm-forum/changing-field-style-for-problem-tasks-if-due-date-is-passed/m-p/457325#M29104</guid>
      <dc:creator>The Machine</dc:creator>
      <dc:date>2020-03-18T18:41:19Z</dc:date>
    </item>
    <item>
      <title>Re: Changing Field Style for Problem Tasks if due date is passed</title>
      <link>https://www.servicenow.com/community/itsm-forum/changing-field-style-for-problem-tasks-if-due-date-is-passed/m-p/457326#M29105</link>
      <description>&lt;P&gt;Sweet!&amp;nbsp; That last value script seems to do the trick.&amp;nbsp; I'm seeing the red dot on all due dates in the past.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hate to press my luck, but what if I don't want this style for tasks that are "Closed Complete"?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 18 Mar 2020 19:22:02 GMT</pubDate>
      <guid>https://www.servicenow.com/community/itsm-forum/changing-field-style-for-problem-tasks-if-due-date-is-passed/m-p/457326#M29105</guid>
      <dc:creator>Joe Taylor</dc:creator>
      <dc:date>2020-03-18T19:22:02Z</dc:date>
    </item>
    <item>
      <title>Re: Changing Field Style for Problem Tasks if due date is passed</title>
      <link>https://www.servicenow.com/community/itsm-forum/changing-field-style-for-problem-tasks-if-due-date-is-passed/m-p/457327#M29106</link>
      <description>&lt;P&gt;Here's what I'm trying, but I still see the red dot on all PTASK,even those that are closed.&lt;/P&gt;
&lt;P&gt;javascript: var answer = (current.due_date.getDisplayValue() &amp;lt;= (new GlideDateTime().getDisplayValueInternal())) &amp;amp;&amp;amp; current.sys_class_name == 'problem_task' &amp;amp;&amp;amp; current.state != 'Closed Complete'; answer;&lt;/P&gt;</description>
      <pubDate>Wed, 18 Mar 2020 19:48:57 GMT</pubDate>
      <guid>https://www.servicenow.com/community/itsm-forum/changing-field-style-for-problem-tasks-if-due-date-is-passed/m-p/457327#M29106</guid>
      <dc:creator>Joe Taylor</dc:creator>
      <dc:date>2020-03-18T19:48:57Z</dc:date>
    </item>
    <item>
      <title>Re: Changing Field Style for Problem Tasks if due date is passed</title>
      <link>https://www.servicenow.com/community/itsm-forum/changing-field-style-for-problem-tasks-if-due-date-is-passed/m-p/457328#M29107</link>
      <description>&lt;P&gt;You are almost there.&lt;/P&gt;
&lt;P&gt;Only thing you need to change is "Closed Complete". Its the label and you need&amp;nbsp;to replace it with backend value of it which might be a numberical value (btw the state on problem_task has Closed [value - 157] OOTB). If you are using OOTB values then you could use&lt;/P&gt;
&lt;PRE class="language-javascript"&gt;&lt;CODE&gt;javascript: var answer = (current.due_date.getDisplayValue() &amp;lt;= (new GlideDateTime().getDisplayValueInternal())) &amp;amp;&amp;amp; current.sys_class_name == 'problem_task' &amp;amp;&amp;amp; current.state != '157'; answer;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Easiest way to get backend values is to get the filter you want on list view (of table required in this case task) and then right click on breadcrumbs &amp;gt;&amp;gt; Copy query. This will give you all the field names and backed values used in the filters. Use the same values in your code.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;-Tanaji&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;Please mark response correct/helpful if applicable&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 18 Mar 2020 20:36:31 GMT</pubDate>
      <guid>https://www.servicenow.com/community/itsm-forum/changing-field-style-for-problem-tasks-if-due-date-is-passed/m-p/457328#M29107</guid>
      <dc:creator>Tanaji Patil</dc:creator>
      <dc:date>2020-03-18T20:36:31Z</dc:date>
    </item>
    <item>
      <title>Re: Changing Field Style for Problem Tasks if due date is passed</title>
      <link>https://www.servicenow.com/community/itsm-forum/changing-field-style-for-problem-tasks-if-due-date-is-passed/m-p/457329#M29108</link>
      <description>&lt;P&gt;That's awesome!&amp;nbsp; Thanks for the tip about looking at values in a list view.&amp;nbsp; That will really help in the future.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So here's what I have now that's working perfectly:&lt;/P&gt;
&lt;P&gt;javascript: var answer = (current.due_date.getDisplayValue() &amp;lt;= (new GlideDateTime().getDisplayValueInternal())) &amp;amp;&amp;amp; current.sys_class_name == 'problem_task' &amp;amp;&amp;amp; current.state&amp;nbsp; &amp;lt; '3' ; answer;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I then went ahead and created another style for "green":&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;javascript: var answer = (current.due_date.getDisplayValue() &amp;gt; (new GlideDateTime().getDisplayValueInternal())) &amp;amp;&amp;amp; current.sys_class_name == 'problem_task'; answer;&lt;/P&gt;
&lt;P&gt;background-color: green&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This works fine too.&amp;nbsp; So with both of these every PTASK has a green or red dot.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Now I'm trying to get a little fancier.&lt;/P&gt;
&lt;P&gt;I want to only make those PTASKS green that are more than 7 days in the future.&lt;/P&gt;
&lt;P&gt;So I did this, but it doesn't work.&amp;nbsp; No tasks show up with green dots.&lt;/P&gt;
&lt;P&gt;javascript: var answer = (current.due_date.getDisplayValue() &amp;gt; 7 + (new&amp;nbsp; &amp;nbsp; GlideDateTime().getDisplayValueInternal())) &amp;amp;&amp;amp; current.sys_class_name == 'problem_task'; answer;&lt;/P&gt;
&lt;P&gt;background-color: green&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm guessing these Fields styles are evaluated sequentially and when all the conditions are met for one, it stops evaluating more.&amp;nbsp; Is this correct?&lt;/P&gt;
&lt;P&gt;So here's my logic:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Style1 (red) If due date is &amp;lt; current date&lt;/P&gt;
&lt;P&gt;Style2 (green) If due date is &amp;gt; current date + 7 days&lt;/P&gt;
&lt;P&gt;Style3 (yellow) If due date is &amp;gt; current date AND &amp;lt;= current date + 7 days&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 19 Mar 2020 13:27:41 GMT</pubDate>
      <guid>https://www.servicenow.com/community/itsm-forum/changing-field-style-for-problem-tasks-if-due-date-is-passed/m-p/457329#M29108</guid>
      <dc:creator>Joe Taylor</dc:creator>
      <dc:date>2020-03-19T13:27:41Z</dc:date>
    </item>
    <item>
      <title>Re: Changing Field Style for Problem Tasks if due date is passed</title>
      <link>https://www.servicenow.com/community/itsm-forum/changing-field-style-for-problem-tasks-if-due-date-is-passed/m-p/457330#M29109</link>
      <description>&lt;P&gt;You cannot add integers to date objects directly. You need to use addDays().&lt;/P&gt;
&lt;P&gt;Try this for green-&lt;/P&gt;
&lt;P class="ng-scope"&gt;javascript: var gdt = new GlideDateTime(); &lt;STRONG&gt;&lt;EM&gt;gdt.addDays(7)&lt;/EM&gt;&lt;/STRONG&gt;; var answer = (current.due_date.getDisplayValue() &amp;gt; gdt.getDisplayValueInternal()) &amp;amp;&amp;amp; current.sys_class_name == 'problem_task'; answer;&lt;/P&gt;
&lt;P class="ng-scope"&gt;background-color: green&lt;/P&gt;
&lt;P class="ng-scope"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class="ng-scope"&gt;Similarly for yellow try this-&lt;/P&gt;
&lt;P class="ng-scope"&gt;javascript: var gdt = new GlideDateTime();&amp;nbsp;gdt.addDays(7); var answer = (current.due_date.getDisplayValue() &amp;gt; (new GlideDateTime().getDisplayValueInternal())) &amp;amp;&amp;amp; (current.due_date.getDisplayValue() &amp;lt;= gdt.getDisplayValueInternal()) &amp;amp;&amp;amp; current.sys_class_name == 'problem_task'; answer;&lt;/P&gt;
&lt;P class="ng-scope"&gt;background-color:&amp;nbsp;yellow&lt;/P&gt;
&lt;P class="ng-scope"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class="ng-scope"&gt;No, there is no order (and no order field) in evaluating these tyles. I believe it will simple pick up a random one if that happens. So make sure none of your condition is having collision with other.&lt;/P&gt;
&lt;P class="ng-scope"&gt;I see that you have included&amp;nbsp;current.state in the red style. Shouldn't it be in others as well? (Like&amp;nbsp;&lt;EM&gt;current.state &amp;gt;= 3&lt;/EM&gt; or&amp;nbsp;&lt;EM&gt;current.state&lt;/EM&gt; &amp;lt; 3 or&amp;nbsp;&lt;EM&gt;current.state == 3&lt;/EM&gt;)&lt;/P&gt;
&lt;P class="ng-scope"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class="ng-scope"&gt;-Tanaji&lt;/P&gt;
&lt;P class="ng-scope"&gt;&lt;EM&gt;&lt;STRONG&gt;Please mark response correct/helpful if applicable&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 19 Mar 2020 14:46:09 GMT</pubDate>
      <guid>https://www.servicenow.com/community/itsm-forum/changing-field-style-for-problem-tasks-if-due-date-is-passed/m-p/457330#M29109</guid>
      <dc:creator>Tanaji Patil</dc:creator>
      <dc:date>2020-03-19T14:46:09Z</dc:date>
    </item>
    <item>
      <title>Re: Changing Field Style for Problem Tasks if due date is passed</title>
      <link>https://www.servicenow.com/community/itsm-forum/changing-field-style-for-problem-tasks-if-due-date-is-passed/m-p/457331#M29110</link>
      <description>&lt;P&gt;Thank you so much!&lt;/P&gt;
&lt;P&gt;Everything is working exactly as I was hoping for now.&lt;/P&gt;
&lt;P&gt;Red, Yellow and Green dots are showing up on Task View and problem view with corresponding due dates.&lt;/P&gt;
&lt;P&gt;Here's what my 3 styles finally look like now:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Table: Task&lt;/P&gt;
&lt;P&gt;Field Name:&amp;nbsp; Due Date&lt;/P&gt;
&lt;P&gt;Value:&amp;nbsp;javascript: var answer = (current.due_date.getDisplayValue() &amp;lt;= (new GlideDateTime().getDisplayValueInternal())) &amp;amp;&amp;amp; current.sys_class_name == 'problem_task' &amp;amp;&amp;amp; current.state&amp;nbsp; &amp;lt; '3' ; answer;&lt;/P&gt;
&lt;P&gt;background-color: red&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Table: Task&lt;/P&gt;
&lt;P&gt;Field Name:&amp;nbsp; Due Date&lt;/P&gt;
&lt;P&gt;Value: javascript: var answer = (current.due_date.getDisplayValue() &amp;gt; (new GlideDateTime().getDisplayValueInternal())) &amp;amp;&amp;amp; current.sys_class_name == 'problem_task' &amp;amp;&amp;amp; current.state&amp;nbsp; &amp;lt; '3' ; answer;&lt;/P&gt;
&lt;P&gt;background-color: yellow&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Table: Task&lt;/P&gt;
&lt;P&gt;Field Name:&amp;nbsp; Due Date&lt;/P&gt;
&lt;P&gt;javascript: var gdt = new GlideDateTime(); gdt.addDays(7); var answer = (current.due_date.getDisplayValue() &amp;gt; gdt.getDisplayValueInternal()) &amp;amp;&amp;amp; current.sys_class_name == 'problem_task' &amp;amp;&amp;amp; current.state &amp;lt; '3' ; answer;&lt;/P&gt;
&lt;P&gt;background-color: green&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Couldn't use your suggest value for "yellow" since it was too long to fit into the window.&lt;/P&gt;
&lt;P&gt;But my three styles seem to be evaluated correctly anyway.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks again&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 19 Mar 2020 16:39:24 GMT</pubDate>
      <guid>https://www.servicenow.com/community/itsm-forum/changing-field-style-for-problem-tasks-if-due-date-is-passed/m-p/457331#M29110</guid>
      <dc:creator>Joe Taylor</dc:creator>
      <dc:date>2020-03-19T16:39:24Z</dc:date>
    </item>
  </channel>
</rss>

