[PYTHON SCRIPT] Mark as FCR

[PYTHON SCRIPT] Mark as FCR

Hi all,

Another script I thought may be useful for some of you out there, this will automatically mark any ticket as FCR.

Just create a custom trigger based and set the following:

  1. python FCR.py $WORKORDERID


FCR.py

  1. url = "YOUR ENVIRONMENT"
    techkey = "YOUR API KEY"

    import requests
    import json
    import sys

    # Construct JSON input data
    inputdata = '''{
        "request": {
            "is_fcr": "true"
            }
    }'''

    param = {
        "TECHNICIAN_KEY":techkey,
        "input_data":inputdata,
        "format":"json"
    }


    try:
        woid = sys.argv[1]
        # Modify RESTAPI operation
        r = requests.request("PUT", url + str(woid), params = param )
        if r.json()["response_status"]["status"] == "success":
            # Successful status message
            print ("Ticket has automatically been marked as FCR.")

        else:
            print (r.json()["response_status"]["messages"])

    except Exception as e:
        print ("Update failed with Error: {}".format(str(e)))


                  New to ADSelfService Plus?