Tuesday 25 May 2021

Add a Hyperlink in Help Menu | Maximo

To add an external Hyperlink to the Help Menu in Maximo.



1. Export MENUS.xml from Application Designer application. 

2.Open it in any text editor and search for <menu id="HELP">

3. Now add this line at your choice as below: 

    <menu id="HELP">
        <menuitem event="maximohelp" id="tophelp" image="menu_icon_apphelp.gif" label="IBM Knowledge Center" licensekey="EAMTOPHELPMENU" value="mxe.help.maximohelplink"/>
        <menuitem event="apphelp" id="help1" image="menu_icon_apphelp.gif" label="Help"/>
        <menuitem id="IBMesupport" label="IBM Electronic Support">
            <menu id="IBMesupportsub">
                <menuitem event="loadlink" id="esupportmam" label="Asset Management Online Support" link="http://www.ibm.com/support/docview.wss?uid=swg21418666&amp;ibmprd=tivmx7"/>
                <menuitem event="loadlink" id="esupport3" label="IBM Support Assistant" link="http://www.ibm.com/software/support/isa?ibmprd=tivmx7"/>
                <menuitem event="loadlink" id="esupport4" label="Support Portal" link="http://www.ibm.com/support/entry/portal?tivmx7"/>
                <menuitem event="loadlink" id="esupport5" label="My Notifications" link="http://www.ibm.com/support/mynotifications?ibmprd=tivmx7"/>
                <menuitem event="loadlink" id="esupport6" label="Cloud and Smarter Infrastructure Software Training and Certification" link="http://www.ibm.com/software/tivoli/education/index.html?ibmprd=tivmx7"/>
                <menuitem event="loadlink" id="IBMcorp" label="IBM Corporation" link="http://www.ibm.com"/>
                <menuitem event="loadlink" id="Google" label="Google Search" link="http://www.google.com"/>
            </menu>
4. Import again into Application designer, and you are done. 





Reference: https://www.ibm.com/support/pages/how-hyperlink-new-browser-window-maximo-title-bar

Monday 24 May 2021

Call Maximo Script from Rest API (http call) (Create SR Example) | Maximo

 Create a simple script in Maximo and Call the Maximo Rest API request to post/get the data.

Let's create a simple automation script, it will create an SR with minimal information. 

1. create a script in automation script application with below code:

from psdi.server import MXServer;
srSet = MXServer.getMXServer().getMboSet("SR", MXServer.getMXServer().getSystemUserInfo());
newSR = srSet.add();
newSR.setValue("TICKETID", request.getQueryParam("ticketid"));
newSR.setValue("DESCRIPTION", request.getQueryParam("description"));
srSet.save();


2. Now send below  request from Postman or any other tool:

http://localhost/maximo/oslc/script/createjsonsr?_lid=maxadmin&_lpwd=maxadmin&ticketid=123&description=test ticket


or We also can send the data in payload

POST http://localhost/maximo/oslc/script/createjsonsr

MAXAUTH <encoded 64bit>

{
    "ticketid" : "123456",
    "siteid" : "BEDFORD",
    "description" : "test SR from http call"
}


 

parameter appended in query string after (?)

request.getQueryParam("variable")

To get the user info from the request

request.getUserInfo()

read and parse the request to get the payload. 

res = JSONObject.parse(output)
vId = res.get("id")
mbo.setValue("description",vId)


Sunday 23 May 2021

SurveyMonkey Integration – Call External API from Automation Script | Maximo

In the continuation of my last post "integration with Survey Monkey through Zapier". 

I had another requirement to implement a customization to directly call the external API of Survey Monkey from Maximo.

Below are the 2 steps procedure, first is the list of APIs we are going to call in a sequence from Maximo Automation Script, and then the detail code I used.

Prerequisites: 

  • Survey Moneky Account, Token
  • Design Survey and enable "Embed First Question" in the Email
  • Create an Email collector 
  • Get the id of the newly created Email Collector


A. Three APIs we are going to call for this project from Automation Script: 

  1. https://api.surveymonkey.net/v3/collectors/{{COLLECTOR_ID}}/messages
    1. {
        "type""invite",
        "subject""Survey for the Ticket {{myextrafield}} {{CustomData1}}",
        "is_branding_enabled"true,
        "embed_first_question"true
      }
  2. https://api.surveymonkey.net/v3/collectors/{{COLLECTOR_ID}}/messages/{{MESSAGE_ID}}/recipients
    1. {     "email""abdulqadeer.el@gmail.com",     "custom_fields": {    "1""c1"},     "extra_fields": {     "myextrafield""1234"   }    }
  3. https://api.surveymonkey.net/v3/collectors/{{COLLECTOR_ID}}/messages/{{MESSAGE_ID}}/send
    1. { }

B. Jython code can be implemented on any object, for testing I am using SR object before-save trigger. 

Monday 17 May 2021

Invoke End Point from Automation Script | Maximo

 To read from any webservice/rest as a client, just use below code to call any existing endpoint with http handler. 


from java.util import HashMap,Calendar

from com.ibm.json.java import JSONObject

response=service.invokeEndpoint("SURVEY-endpoint name",map,body1)

body = JSONObject.parse(response)

mbo.setValue("description",response[:200])

#mbo.setValue("description",body.get("data")[1].get("email"))

Tuesday 11 May 2021

Send SurveyMonkey from Maximo using Zapier (Call a query string from Automation Script)

Calling an external URL from Maximo Automation scirpt to achieve this requirement. 

Requirement was; To send SurveyMonkey's survey to the EndUser/Customer when the  status of Service Request is Resolved.

3 things we needs for this excerise:

  1. Maximo Automation 
  2. Zapier Webhook
  3. Survey Email in Survey Monkey

1. Design a survey in Survey Monkey, Create Collector as Email. 

2. In Zapier make a Catch Hook, get the API  and append any parameter as query string (&ownerid) etc.

3. In Zapier make an Action to connect with Survey Monkey and trigger Contact Send.