Setting up Monotonic Serial Number generation

Comments

5 comments

  • Official comment
    Ivo Clarysse

    serial_number is a mandatory field for the response payload for this command, and assigned to the built-in %SERIAL_NUMBER% key.

      - steps:
      - command: serial request
        - command: operator "%SERIAL_NUMBER%"

    Additional keys can be specified for extraction from an optional "extra" object in the response payload.

    {
    "serial_number": "SN0013",
    "extra": {
    "my_group_id": "MFG"
    }
    }

    With this YAML fragment:

    - steps:
    - command: serial request GROUP:my_group_id
    - command: operator "%GROUP% %SERIAL_NUMBER%"
    Comment actions Permalink
  • Malcolm Knapp

    I wanted to follow up about this. Any thoughts?

    0
    Comment actions Permalink
  • Malcolm Knapp

    Ah, I figured it out. Serial numbers are not added automatically. They have to be explicitly requested from PLTcloud using the following:

    - command: serial request

    0
    Comment actions Permalink
  • Michael Stumpf

    Malcolm Knapp could you please post what code you used to get the monotonic serial number? I'm trying to pull it from my project with the following but I'm having trouble dereferencing the KEY I use to get the serial_number. 

      steps:
      - command: serial request NUM:serial_number
      - command: operator %NUM%
    Num just shows up as "%NUM%"
    0
    Comment actions Permalink
  • Michael Stumpf

    Ivo Clarysse

    Thanks for the update. I don't see a list in the documentation for "built in keys" is there a link for those? The only docs on serial number I could find was from the webhook https://docs.pltcloud.com/TestPlanReference/command/serial/ 

    0
    Comment actions Permalink

Please sign in to leave a comment.