Modify com.glideapp.servicecatalog_checkout_view

ravali6
Giga Contributor

I was trying to modify the UI Page 'com.glideapp.servicecatalog_checkout_view'.
I am trying to add 'state' field which changes based on the 'stage' field from Workflow on the ticket. I am able to retrieve the value coming from the 'stage' field. But when I am trying to write an IF statement and comparing to the value, it is not working. It is in Jelly Scripting. Can anyone help be in the debug?
SEE THE SCREENSHOT BELOW

13 REPLIES 13

ravali6
Giga Contributor

//See the the code in the screenshot//


Jim Coyne
Kilo Patron

Try this for your if statement:



<j2:if test="$[sc_req_item.stage == 'complete']">
Click for Status<button onclick="test_button()" id="status.$[sc_req_item.number]" name="status.$[sc_req_item.number]" value="$[sc_req_item.number]"
style="background-color: white; border: none"><img src="image.jpgx" width="l8" height="l8"/></button>
</j2:if>


I also changed the id and name of the button so it would be unique when multiple catalog items are ordered.


Thanks Jim. It kind of worked. I have a couple of questions:

(1) So in 'id' and 'name' you passed 'status.$[sc_req_item.number]' is it the value of request item passed.
When there are multiple RITMs in the same REQ, the Tasks for every item is same as the SCTSK of first RITM.
Example:

REQ xyz has 3 RITMs

state field
RITM1 Button 1
RITM2 Button 2
RITM3 Button 3

When I click on any of the buttons I am expecting the tasks to come up when state= fullfillment or complete, on waiting for approval, just button no pop up with tasks. But Every button upon click shows the SCTSCK of the first RITM in the list.

Please let me know where I am doign it wrong. I have attached the code for the buttons and the Test_button function.


function test_button(){
var item = gel("status.$[sc_req_item.number]").value;
//Initialize and open the Dialog Window
var dialog = new GlideDialogWindow('test_dialog'); //Render the dialog containing the UI Page 'terms_and_conditions_dialog'
dialog.setTitle('Catalog tasks'); //Set the dialog title
dialog.setSize(1000,1000); //Set the dialog size
dialog.setPreference("item_num", item);
dialog.render(); //Open the dialog
}


The id and name of the buttons will end up being something like "status.RITM000123", "status.RITM000124", etc...

Can you add the "test_dialog" UI Page to the demo11 instance? I added my code and the "test_button" function but I need to see the UI Page in order to see how it is all working. You can see the link appear in the Order Status page when you order a "Blackberry" catalog item.