Maximo Open Forum

 View Only
Expand all | Collapse all

Automation script to retrieve WorkItem data from RTC using OSLC REST from Python

  • 1.  Automation script to retrieve WorkItem data from RTC using OSLC REST from Python

    Posted 07-13-2023 13:45
    Edited by Rick Viera 03-28-2024 09:12

    I'm attempting to retrieve WortkItem data from RTC making calls my REST calls from Python in an automation script.  Knowing nothing about RTC or REST I've managed to get a working prototype working in Visual Studio Code using Jupyter to test my code as I go along.  I've gotten the roughed in fundamentals and I'm getting back the workitem JSON object.  Before I moved on to making the code presentable I decided to place the code into an automation script and have it launched from an action for ease of testing.  Unfortunately I'm getting errors on both of the import statements:

    import requests
    import json
    ImportError: cannot import name requests in <script> at line number 1
    ImportError: No module named requests in <script> at line number 1
    I'm thinking that there may be a jar file that I need to add to "C:\IBM\WebSphere\AppServer\lib\ext" but I don't know what that would be or where I would get it.
    Any help/guidance would be so gratefully appreciated.


    #Customizations
    #Integrations
    #MaximoApplicationSuite

    ------------------------------
    Rick Viera
    General Dynamics Mission Systems
    ------------------------------

    I have a solution in Python.  If there is any interest I can post the source.



  • 2.  RE: Automation script to retrieve WorkItem data from RTC using OSLC REST from Python

    Posted 07-14-2023 10:21

    You need to develop your prototype in a method in Java, not Python, then port the Java method into a script in Maximo. In Maximo, you have all of the Java libraries that Maximo does to do all of its wonderful stuff, but you don't have the Python ones. Rather than fight to get all of Python into Maximo, you should grab a coffee and go with Java libraries accessed from the sleek syntax of Python.



    ------------------------------
    Jason Uppenborn
    Cohesive
    ------------------------------