TeamDynamix Admins: iPaaS ShortCode Validation

Environment

TeamDynamix, iPaaS, JSON

Issue

Provides an explanation of how to use iPaaS in your TeamDynamix ticketing application workflows.

Resolution

Flow name: flow:validate_shortcode

Purpose: Lookup and return information about a shortcode and optionally return information to the ticket by patching custom attributes or updating the feed. Returning information to ticket attributes will require custom attributes on the ticket to update.

This flow requires a single shortcode to lookup. It will return a true/false value to the workflow. A ‘success’ or ‘failure’ of the workflow step both indicate that something went wrong. It is important to follow the wait for results instructions if the workflow is to make automated decisions based on whether or not the shortcode is valid. The ‘success’ and ‘failure’ nodes of a workflow step should not be used when working with the validate_shortcode flow.

How to use

  1. From within a TeamDynamix workflow, create a new step with the type ‘TeamDynamix IPaaS’
  2. Name the workflow step.
  3. Choose flow:validate_shortcode in the IPaaS Flow field.
  4. Choose Latest Published Version in the IPaaS Flow Version field.
  5. See example code snippets below for acceptable values for the Additional Arguments Json field.
  6. Check the Wait for Results checkbox.
  7. Click the Add Result button and add:
    1. ‘isValid’
      1. Will be returned with ‘Shortcode is valid’ for a valid shortcode
  8. Click the Add Result button and add:
    1. ‘notValid’
      1. Will be returned with ‘Shortcode is not valid’ for an invalid shortcode 
  9. This will allow for additional logic to be built into the workflow to change the path based on the validity of the shortcode.
  10. Save the workflow step and connect it in the workflow.

 

Order of operations

  1. Lookup Shortcode
  2. Patch Ticket
  3. Update feed

 

JSON Layout

{
  "shortcode": "",
  "feed": [
    "field1", “field2”
  ],
  "returnattrs": [
    {
      "field1": "{{attrid}}"
    },
    {
      "field(x)": "{{attrid}}"
    }
   ]
  }

ShortCode - Send - Required

Key Name

Description

Accepted Value

shortcode

The shortcode that will be looked up.

Shortcode or {{attrid}} from the ticket containing a single shortcode.

Feed - Return - Optional

A comma separated list of values to return to the feed. Values will be added to the feed one per line with the field name ( fieldname : value ).

Key Name

Description

Accepted Value

feed

A list of values to return to feed.

Any key name from the return attributes table.

Return Attributes - Return - Optional

A list of key-value ( {“isValid”: “{{xxxxxx}}”} ) pairs to return to the ticket. The key represents what data should be returned, and the value is the attribute id the data should be sent to. Any combination of values can be returned, but they must all have a unique custom attribute on the form.

Key Name

Description

Returns data to

isvalid

True/False return of whether the shortcode is valid. This value is true if the shortcode api returns ‘open’ or ‘endowment’.  It will return false for all other shortcode statuses. 

{{attrid}}

programCode

The program code returned by the shorcode api.

{{attrid}}

fundCodeDesc

The fund code description returned by the api.

{{attrid}}

deptid

The department id returned by the api.

{{attrid}}

programCodeDesc

The program code description returned by the api.

{{attrid}}

projectGrant

The project grant data returned by the api.

{{attrid}}

class2Desc

The class 2 description returned by the api

{{attrid}}

deptDesc

The department description returned by the api.

{{attrid}}

fundCode

The fund code returned by the api.

{{attrid}}

shortCodeDesc

The short code description returned by the api.

{{attrid}}

class

The class returned by the api.

{{attrid}}

statusDesc

The status description returned by the api.

{{attrid}}

Note:  The flow believes a shortcode is valid if it has the status of ‘open’ or ‘endowment’.  Any other status is invalid.


Flowchart showing the flow sequence for Validate Shortcode
Examples

Basic shortcode lookup from a custom attribute on a form, with a workflow that branches based on validity. This returns no data to the ticket but allows the workflow to branch.

{
  “shortcode”:”{{11223}}”
}

Validate a shortcode and return the department description to a custom attribute of the ticket.

{
  "shortcode": "112233",
  "returnattrs": [
    {
      "deptDesc": "{{332211}}"
    }
  ]
}

Validate a shortcode and return the department description and shortcode description to a custom attribute of the ticket.

{
  "shortcode": "112233",
  "returnattrs": [
    {
      "deptDesc": "{{332211}}"
    },
    {
      “shortCodeDesc”: “{{223344}}
    }
  ]
}

Validate a shortcode and return the department description and shortcode description to a custom attribute of the ticket, update the feed with the fund code description and the shortcode status description.

{
  "shortcode": "112233",
  “feed”: [
     “fundCodeDesc”, “statusDesc”
    ]
  "returnattrs": [
    {
      "deptDesc": "{{332211}}"
    },
    {
      “shortCodeDesc”: “{{223344}}
    }
  ]
}

Additional Information

Need additional information or assistance? Submit a request here: ITS-TeamDynamix Support.

 

Details

Article ID: 9630
Created
Fri 2/3/23 11:38 AM
Modified
Tue 5/2/23 4:39 PM