Create UI Macro Button next to Priority Field and display a text explaining the Priority values

Hari7
Kilo Guru

Hello All,

 

I want to create UI Macro Button next to Priority Field (like the below image) and display a text explaining the Priority values 1,2,3,4. Priority field is an OOB field from task and used on the story table. Request you to help on the UI Macro on how to build this. 

 

Hari7_0-1692403167505.png

 

 

 

1 ACCEPTED SOLUTION

AnveshKumar M
Tera Sage
Tera Sage

Hi @Hari7 ,

Follow along to get your requirement.

 

UI Page:

Create a UI Page as below,

name: priority_info_ui_page

Script:

 

<?xml version="1.0" encoding="utf-8" ?>
<j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null">
<g:evaluate var="jvar_loc_name" jelly="true">

<div>
<b>P1:</b> <p>Your explaination</p>
<b>P2:</b> <p>Text for P2</p>
<b>P3:</b> <p>Text for P3</p>
<b>P4:</b> <p>Text for P4</p>
</div>
</j:jelly>

 

Create a UI Macro (System UI -> UI Macros -> New):

create an UI Macro as below.

Namepriority_info_button

Script: 

 


<?xml version="1.0" encoding="utf-8" ?>
<j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null">

<span id="u_priority_info_button" onclick="showPriorityInfo()" title="Priority info" alt="Priority Info" tabindex="0" class="btn btn-default icon-comment">

      <span class="sr-only">Priority info</span>

</span>

<script type="text/javascript">
function showPriorityInfo(){
var gm = new GlideModal("priority_info_ui_page");
gm.setTitle("Priority information");
gm.setWidth(400);
gm.render();
}
</script>
</j:jelly>

 

Add it to the Priority Field:

Now we have to attach this UI Macro to the Priority field.

1. Right click on Priority field label and select "Configure Dictionary"

2. If you couldn't see Attributes field In the dictionary form opened, click on Advanced View related link at the page bottom.

3. If the field doesn't have any attributes adde just past this "ref_contributions=priority_info_button". If there are attributes already present just add a , at the end paste the above string.

 

Thanks,
Anvesh

View solution in original post

7 REPLIES 7

@Kartik Gopal Thanks.

 

Actually that g: evaluate is not required, you can remove that line.

Thanks,
Anvesh

Actually the code worked only after closing the g: evaluate loop. Thanks for your help on this.

Hi @Hari7 ,

I meant to say the line <g:evaluate var="jvar_loc_name" jelly="true"> itself I forgot to remove after copying the code from my PDI. If you just remove this line no need to add closing the g:evaluate tag.

 

Anyway, it helped you, happy for that 🙂

Thanks,
Anvesh