Alert response question

Not Yet Reviewed

couple of questions :
Are there any more response types other than "acknowledge" and "reject" and what are their uses.

can we allow users to add notes to an alert when they "acknowledge" or "reject" or any response to an alert.

0

Comments

13 comments
Date Votes

Please sign in to leave a comment.

  • There are more response types as they are configurable. I guess you'd have to give more information on "response types for what".

    Users can add notes to alerts they respond to. The easiest way is by using the mobile app (assuming you have xMatters On Demand). When you responded via the app, you're pompted if you want to "respond with comments". Here's a good page on it (search for "respond with comment") [https://support.xmatters.com/hc/en-us/articles/202994865-Fall-2014-Release-Overview].
    You can do the same with email, but it's more manual (info towards the bottom): https://help.xmatters.com/ondemand/content/userguide/receivingalerts/respondviaemail.htm

    0
  • John, Andrew has some good info here, but I think you guys are on premise and not on demand, so the answer will be a little different. In the on premise product, the response options are kept in the $content.choices variable that is typically populated in the initial script. As for adding notes, this is a feature we call "annotations". In the response.handler script you should see some parsing of the "rest" of a response to populate an "annotation" variable.
    I hope that helps.

    0
  • Hi Travis, do you have an example that i can refer with..

    0
  • Not just handy, I can probably get one tomorrow or so. You can also download an integration that uses those action scripts, such as the ServiceNow 2.0 integration or the older Remedy integrations. Those are pretty "advanced" and will have a lot of examples of code usage.

    0
  • Travis, Any chance you got an example for me for adding notes to an alert when they acknowledge /reject..

    0
  • Hi Travis, waiting for an example which i can refer to make this work..

    email response with text..

    0
  • also when we respond to the email with certain text, will the text be part of the alert going ahead.

    0
  • This is from the ServiceNow 2.0 action scripts.
    In the Handler > Response script, there is a section that tests if a response was received:

      ELSE-IF ( $responseEvent == "RECEIVED_RESPONSE" )
        # Build the list of valid responses, extract the response command and annotation from the 
        # reply text, then do the actual response processing.
        CALL buildUserResponseMap
        GOSUB getActionTokenAndAnnotationText
        CALL processUserResponse
    

    The getActionTokenAndAnnotationText subroutine. Notice the $annotationText variable below.

    # ===========================================
    # getActionTokenAndAnnotationText
    #
    # Iterate over the userResponseMap and see if the start of the reply from the user corresponds 
    # to any of the responses we're expecting. If we find something, extract the annotation, if found.
    #
    # Input: $userResponseMap, $responseTokens
    # Output: $actionToken, $annotationText
    # =======================================
    getActionTokenAndAnnotationText:
    
    # -------------------------- getActionTokenAndAnnotationText -----------------------------------
    
    $actionToken = ""
    
    # Set up to parse the user response
    $responseTokens = $response.reply
    $responseTokens::trim()
    $responseTokens::toLowerCase()
    
    @userResponseMap::clearIterator()
    $hasNext = @userResponseMap::hasNext()
    
    WHILE( $hasNext && ($actionToken == "") )
    
      @entry = @userResponseMap::getNext()
    
      $key = @entry::getKey()
      $key::toLowerCase()
    
      $value = @entry::getValue()
    
      $log_message = "Map entry = [" & $key & ", " & $value & "], responseTokens = [" & $responseTokens & "]"
      GOSUB logMessageNote
    
      $keyMatches = $responseTokens::startsWith($key)
      IF ($keyMatches)
        $matchedToken = $key
        $actionToken = $value
      ENDIF
    
      $hasNext = @userResponseMap::hasNext()
    
    ENDWHILE
    
    IF ($actionToken != "")
      # -------------------------- Found a valid action token -----------------------------------
      # Any part of the response beyond what we matched against is an annotation.
      $matchedTokenLength = $matchedToken::length()  
      $responseTokensLength = $response.reply::length()
    
      IF ($responseTokensLength > $matchedTokenLength)
        $annotationText = $response.reply::substring( $matchedTokenLength + 1 )
        $annotationText::trim()
      ENDIF
    ENDIF
    
      $log_message = "actionToken = [" & $actionToken & "], annotationText = [" & $annotationText & "]"
      GOSUB logMessageNote
    
    RETURN
    
    0
  • Let's try that again....
    This is from the ServiceNow 2.0 action scripts.
    In the Handler > Response script, there is a section that tests if a response was received:

    ELSE-IF ( $responseEvent == "RECEIVED_RESPONSE" )
      # Build the list of valid responses, extract the response command and annotation from the 
      # reply text, then do the actual response processing.
      CALL buildUserResponseMap
      GOSUB getActionTokenAndAnnotationText
      CALL processUserResponse
    

    The getActionTokenAndAnnotationText subroutine. Notice the $annotationText variable below.

    # ==============================================================================================
    # getActionTokenAndAnnotationText
    #
    # Iterate over the userResponseMap and see if the start of the reply from the user corresponds 
    # to any of the responses we're expecting. If we find something, extract the annotation, if found.
    #
    # Input: $userResponseMap, $responseTokens
    # Output: $actionToken, $annotationText
    # ==============================================================================================
    getActionTokenAndAnnotationText:
    
    # -------------------------- getActionTokenAndAnnotationText -----------------------------------
    
    $actionToken = ""
    
    # Set up to parse the user response
    $responseTokens = $response.reply
    $responseTokens::trim()
    $responseTokens::toLowerCase()
    
    @userResponseMap::clearIterator()
    $hasNext = @userResponseMap::hasNext()
    
    WHILE( $hasNext && ($actionToken == "") )
    
      @entry = @userResponseMap::getNext()
    
      $key = @entry::getKey()
      $key::toLowerCase()
    
      $value = @entry::getValue()
    
      $log_message = "Map entry = [" & $key & ", " & $value & "], responseTokens = [" & $responseTokens & "]"
      GOSUB logMessageNote
    
      $keyMatches = $responseTokens::startsWith($key)
      IF ($keyMatches)
        $matchedToken = $key
        $actionToken = $value
      ENDIF
    
      $hasNext = @userResponseMap::hasNext()
    
    ENDWHILE
    
    IF ($actionToken != "")
      # -------------------------- Found a valid action token -----------------------------------
      # Any part of the response beyond what we matched against is an annotation.
      $matchedTokenLength = $matchedToken::length()  
      $responseTokensLength = $response.reply::length()
    
      IF ($responseTokensLength > $matchedTokenLength)
        $annotationText = $response.reply::substring( $matchedTokenLength + 1 )
        $annotationText::trim()
      ENDIF
    ENDIF
    
      $log_message = "actionToken = [" & $actionToken & "], annotationText = [" & $annotationText & "]"
      GOSUB logMessageNote
    
    RETURN
    
    0
  • And hopefully one more time:
    This is from the ServiceNow 2.0 action scripts.
    In the Handler > Response script, there is a section that tests if a response was received:

    ELSE-IF ( $responseEvent == "RECEIVED_RESPONSE" )
    # Build the list of valid responses, extract the response command and annotation from the
    # reply text, then do the actual response processing.
    CALL buildUserResponseMap
    GOSUB getActionTokenAndAnnotationText
    CALL processUserResponse

    The getActionTokenAndAnnotationText subroutine. Notice the $annotationText variable below.

    ==============================================================================================

    getActionTokenAndAnnotationText

    #

    Iterate over the userResponseMap and see if the start of the reply from the user corresponds

    to any of the responses we're expecting. If we find something, extract the annotation, if found.

    #

    Input: $userResponseMap, $responseTokens

    Output: $actionToken, $annotationText

    ==============================================================================================

    getActionTokenAndAnnotationText:

    -------------------------- getActionTokenAndAnnotationText -----------------------------------

    $actionToken = ""

    Set up to parse the user response

    $responseTokens = $response.reply
    $responseTokens::trim()
    $responseTokens::toLowerCase()

    @userResponseMap::clearIterator()
    $hasNext = @userResponseMap::hasNext()

    WHILE( $hasNext && ($actionToken == "") )

    @entry = @userResponseMap::getNext()

    $key = @entry::getKey()
    $key::toLowerCase()

    $value = @entry::getValue()

    $log_message = "Map entry = [" & $key & ", " & $value & "], responseTokens = [" & $responseTokens & "]"
    GOSUB logMessageNote

    $keyMatches = $responseTokens::startsWith($key)
    IF ($keyMatches)
    $matchedToken = $key
    $actionToken = $value
    ENDIF

    $hasNext = @userResponseMap::hasNext()

    ENDWHILE

    IF ($actionToken != "")
    # -------------------------- Found a valid action token -----------------------------------
    # Any part of the response beyond what we matched against is an annotation.
    $matchedTokenLength = $matchedToken::length()

    $responseTokensLength = $response.reply::length()

    IF ($responseTokensLength > $matchedTokenLength)
    $annotationText = $response.reply::substring( $matchedTokenLength + 1 )
    $annotationText::trim()
    ENDIF
    ENDIF

    $log_message = "actionToken = [" & $actionToken & "], annotationText = [" & $annotationText & "]"
    GOSUB logMessageNote

    RETURN

    0
  • test post in code... ignore
    
    0
  • More test posting sorry guys....

    ELSE-IF ( $responseEvent == "RECEIVED_RESPONSE" )
    # Build the list of valid responses, extract the response command and annotation from the
    # reply text, then do the actual response processing.
    CALL buildUserResponseMap
    GOSUB getActionTokenAndAnnotationText
    CALL processUserResponse

    0
  • Travis, thank you. ill check this out..

    0

Didn't find what you were looking for?

New post