How to display the value of state on string instead of an integer ?

Naples1966
Giga Contributor

I developped the module to display the scroll list of incidents, using System UI, UI pages and Widget. It works well.

there are 3 columns of incidents : Number, state and short description.It displays so well but for state, the code appears. See below 

find_real_file.png

I would like to display the string of state as "open, close, pending, etc..." instead of a code

how to do it ?

In advance, thank you for your return.

Sincerely

1 ACCEPTED SOLUTION

That's Great, Can you please mark my response as the correct answer?

Thanks!

View solution in original post

10 REPLIES 10

Alikutty A
Tera Sage

 

Hello,

Can you paste the script that displays the state value?

Thanks

Hi, In following your message, I pasted the capture of script, see below : and I wish to say me if my script is well ? Because, it is a first time to make it !... see below.... thank you in advance for your return sincerelery ----- scroll incident - script : ----- var inc = new GlideRecord('incident'); inc.addActiveQuery(); inc.addQuery('priority',1); inc.setCategory('homepage'); inc.query();
NumberStateDescription
$[inc.number]$[inc.state]$[inc.short_description]

Can you try this.

$[inc.number]$[inc.state.getDisplayValue()]$[inc.short_description]

Please mark my response as correct and helpful if it helped solved your question.
-Thanks

Just change  $[inc.state] to $[inc.state.getDisplayValue()] and it should fetch you the required state labels