Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Div
idProductTOC

On this page

Table of Contents
maxLevel1
excludeOn this page
typeflat
separator |

...

Recipe overview

This recipe provides step-by-step instructions on how the opening of a Blocker ticket can trigger the automatic creation of a HipChat room in order to communicate about that ticket. This facilitates quick resolution to critically important tickets and ensures effective communication to all interested parties occurs.

This recipe assumes that either the usernames or display names of your JIRA users matches that of your HipChat users.

(info) It will take you approximately 12-13 minutes to complete this recipe.

Recipe level

Table plus
border0
heading0
multiplefalse
enableHeadingAttributesfalse
columnAttributesstyle="border:0;width=5%;",style="border:0;width=65%;",style="border:0;width=30%;max-width=30% !important;"
enableSortingfalse
classingredients_table
enableHighlightingfalse

Ingredients

Table plus
border0
heading0
multiplefalse
enableHeadingAttributesfalse
columnAttributesstyle="border:0;width=5%;",style="border:0;width=65%;",style="border:0;width=30%;max-width=30% !important;"
enableSortingfalse
classingredients_table
enableHighlightingfalse

Preparation

  • N/A

Steps

0
Table plus
border0
heading
Div
idProductTOC

On this page

Table of Contents
maxLevel1
excludeOn this page
typeflat
separator |

Include Page
_RecipeTemplateTopLogo
_RecipeTemplateTopLogo

Recipe overview

This recipe provides step-by-step instructions on how the opening of a highest priority ticket can trigger the automatic creation of a HipChat room in order to communicate about that ticket. This facilitates quick resolution to critically important tickets and ensures effective communication to all interested parties occurs.

(info) It will take you approximately 13-16 minutes to complete this recipe.

Recipe level

Example command:
Table plus
border0
heading0
multiplefalse
enableHeadingAttributesfalse
columnAttributesstyle="border:0;width=5%;",style="border:0;width=65%;",style="border:0;width=30%;max-width=30% !important;"
enableSortingidfalse
classstepsingredients_table
enableSortingenableHighlightingfalse
enableHighlightingfalse
Example expression:

How to Create a HipChat Room to Communicate About a Blocker Ticket

Configure user defined variables

Div
classtime

Image Removed Estimated Time: 2-3 min

In this step, you will be defining variables for the Run CLI Actions in JIRA add-on so that it knows how to connect to your HipChat instance.

I

Turn this into a regular expression (aka Regex expression) that searches for any occurrence of the named words, by separating each word with a pipe ('|') character and then adding .*/\b(?: before it and )\b.* after it.

Anchor
step1step1
No Format
.*\b(?:acquire|acquisition||acquisitions|merger|mergers|aquire|aquisition|aquisitions)\b.*

 

 

How to Create a HipChat Room to Communicate About a Blocker Ticket

Create HipChat CLI command

Div
classtime

Image Removed Estimated Time: 2 min

Use the command shown on the right to invoke the HipChat CLI to scan the chat history of public HipChat rooms to find any references to your list of words and write the results to a file.

  • hipchat indicates to invoke the HipChat CLI client.
  • The runFromRoomList action indicates to retrieve a list of public HipChat rooms and then, for each room, run the action indicated by the --common parameter. (Note that the value of the --common parameter extends up to the final double quote (") character.)
  • The getRoomHistoryList action  that is executed for each room returned by the runFromRoomList action includes these parameters:
    • --room indicates to access the current HipChat room
    • --file indicates to save the references to the words you're monitoring into a file named chatreferences.csv. This file will be saved to the same folder to which you installed the HipChat CLI client. If this is not what you want, you can specify a full path to the file, enclosing it within double quotes:

      No Format
      --file "../yourfolder/chatreferences.csv"
    • --append indicates to append the output to the chatreferences.csv file if it already exists. This is important since the references may be written from multiple HipChat rooms.

    • --regex provides the Regex expression you prepared earlier. Note that this expression is inserted between \" and \" since it must be quoted but appears within the entire --common parameter which is also quoted.

Anchor
step2step2
Code Block
languagetext
themeDJango
linenumberstrue
hipchat --action runFromRoomList --common "--action getRoomHistoryList --room \"@room@\" --file chatreferences.csv --append --regex \".*\b(?:acquire|acquisition|acquisitions|merger|mergers|aquire|aquisition|aquisitions)\b.*\" " 
How to Create a HipChat Room to Communicate About a Blocker Ticket

Execute HipChat CLI command

Div
classtime

Image Removed Estimated Time: 1 min 

In your command window, type the command from the previous step and press Enter.

The command will run, showing the result of executing the GetRunHistoryList action against each public HipChat room (3 rooms in our example).

(warning) Per the HipChat CLI instructions, your hipchat.bat or .sh file contains a --token parameter which supplies the API Access token of a HipChat user. Be sure to use the token of a user who has access to all of the public rooms you wish to monitor.

Anchorstep3step3Example output:
Code Block
languagetext
themeDJango
linenumberstrue
Run: --action getRoomHistoryList --room "ExampleGear Engineering" --file chatreferences.csv --append --regex ".*\b(?:acquire|acquisition|acquisitions|merger|mergers|aquire|aquisition|aquisitions)\b.*" 
2 history entries in list appended to file: chatreferences.csv
Run: --action getRoomHistoryList --room "ExampleGear HR" --file chatreferences.csv --append --regex ".*\b(?:acquire|acquisition|acquisitions|merger|mergers|aquire|aquisition|aquisitions)\b.*" 
1 history entries in list appended to file: chatreferences.csv
Run: --action getRoomHistoryList --room "ExampleGear Marketing" --file chatreferences.csv --append --regex ".*\b(?:acquire|acquisition|acquisitions|merger|mergers|aquire|aquisition|aquisitions)\b.*" 
0 history entries in list
Run completed successfully. 3 actions were successful 

Example CSV file:

Code Block
languagetext
themeDJango
titlechatreferences.csv file
linenumberstrue
"Room","Message Id","Date","Type","Message Format","Message Color","Message","From Id","From Name","From Mention Name","Link Name","Link URL","Link Type"
"ExampleGear Engineering","d75f884d-f5b0-4aa4-ba2c-d273d9da682b","2015-03-25T10:54:04.082-0400","message","","","That'll look great to Acme's auditors as they try to decide whether to follow-thru on the acquisition!","1928057","Hank Johnson","hjohnson","","",""
"ExampleGear Engineering","218e7533-b2b5-40da-91f4-6ff1f9534940","2015-03-25T12:29:59.647-0400","message","","","Whoops, @hjohnson! Everything is hush hush about that subject. There can be absolutely no talk about mergers or acquisitions in public rooms.","1915328","Jasmine Stone","JasmineStone","","",""
"ExampleGear HR","ed202752-f46f-40a9-85a8-ea6c09accda0","2015-03-25T10:42:10.755-0400","message","","","When the acquisition goes through, will HR provide training and guidance to managers on how to communicate the details to their staff?","1915328","Jasmine Stone","JasmineStone","","",""
How to Create a HipChat Room to Communicate About a Blocker Ticket

Create Confluence page

Div
classtime

Image Removed Estimated Time: 2 min

Create a Confluence page that will display the chatreferences.csv file in a table so others can easily review what your language monitoring revealed.

The page consists of 2 items:

  1. An introductory paragraph that describes the purpose of the page or anything else the viewer ought to know.
  2. The CSV macro, which is part of the Advanced Tables for Confluence add-on, configured with the parameters shown on the right.

Save the page, and take note of the space key and the page title.

The space key appears in the URL of the page after you've saved, immediately after "display/". For instance, in the URL http://wiki.examplegear.com/display/EGM/HipChat+Monitoring, the space key is EGM.

 

 

 

Anchorstep4step4CSV Macro parameters:
Output format html
Location of CSV data^chatreferences.csv
Auto number each rowselected
Show sort iconselected
Auto sort columnDate
Column typesS,S,M,S,S,S,S,S,S,S,S,S

Edit view of the page:

Image Removed

   How to Create a HipChat Room to Communicate About a Blocker Ticket

Create Confluence CLI command

Div
classtime

Image Removed Estimated Time: 1 min

Use the command shown on the right to attach the chatreferences.csv to the Confluence page you just created,

  • confluence indicates to invoke the Confluence CLI client.
  • The addAttachment action indicates to attach a file to a Confluence page.
  • The --title parameter provides the Confluence page's title.
  • The --file parameter provides the name of the file to be attached. (This will generally match what you used on the previous HipChat CLI command.)
Anchorstep5step5Example command:
Code Block
languagetext
themeDJango
linenumberstrue
confluence --action addAttachment --space "EGM" --title "HipChat Monitoring"  --file chatreferences.csv
How to Create a HipChat Room to Communicate About a Blocker Ticket

Execute Confluence CLI command

Div
classtime

Image Removed Estimated Time: 1 min

In your command window, type the command from the previous step and press Enter.

The command will run, showing the result of executing the addAttachment action.

(warning) Per the Confluence CLI instructions, your confluence.bat or .sh file contains credentials for a Confluence user. Be sure to use credentials of a user who has read/write access to your Confluence page.

Anchorstep6step6Example output:
Code Block
languagetext
themeDJango
linenumberstrue
Attachment 'chatreferences.csv' of type 'text/csv' added to page 'HipChat Monitoring' in space 'EGM', id: 557107, url: http://wiki.examplegear.com/download/attachments/557100/chatreferences.csv?version=2&modificationDate=1427900084733&api=v2
How to Create a HipChat Room to Communicate About a Blocker Ticket

Review Confluence page

Div
classtime

Image Removed Estimated Time: 1 min

In Confluence, navigate to the page you created to verify the chatreferences.csv file is now attached to the page and it reflects the contents of that file.l

If this page was already open in your browser, you may need to refresh the page.

 

Anchorstep7step7Image RemovedHow to Create a HipChat Room to Communicate About a Blocker Ticket

Create a reusable CLI script

Div
classtime
StatustitleOptional Image Removed Estimated Time: 2 min

If you'd like to save your CLI commands for later reuse, you can save them as a CLI script file.

Using an editor capable of producing a plain text file, such as Notepad (Windows) or TextEdit (Mac), create a script file named:

  • For Windows: monitorRooms.bat
  • For OS X/Linux: monitorRooms

Save it in the same folder to which you installed the HipChat and Confluence CLI clients and make sure it has permissions so that you can read, write and execute it.

Follow these steps in your command window to execute the script file you just created:

  1. Navigate to the folder to which you installed the HipChat and Confluence CLI clients.
  2. Type the name of the script file as shown on the right and press Enter.

The script will run, showing the result of executing each action.

  Anchorstep8step8Contents of example CLI script file:
Code Block
languagetext
themeDJango
linenumberstrue
hipchat --action runFromRoomList --common "--action getRoomHistoryList --room \"@room@\" --file chatreferences.csv --append --regex \".*\b(?:acquire|acquisition|acquisitions|merger|mergers|aquire|aquisition|aquisitions)\b.*\" " 
confluence --action addAttachment --space "EGM" --title "HipChat Monitoring" --file chatreferences.csv 

 

Command to execute reusable script file:

Code Block
languagetext
themeDJango
linenumberstrue
monitorRoomsImage Added

Ingredients

Table plus
border0
heading0
multiplefalse
enableHeadingAttributesfalse
columnAttributesstyle="border:0;width=5%;",style="border:0;width=65%;",style="border:0;width=30%;max-width=30% !important;"
enableSortingfalse
classingredients_table
enableHighlightingfalse

Preparation

  • This recipe assumes that either the usernames or display names of your JIRA users match the usernames or @mention names of your HipChat users. 

  • You will need JIRA Administrator permissions to your JIRA instance in order to complete this recipe.

Steps

Table plus
border0
heading0
multiplefalse
enableHeadingAttributesfalse
columnAttributesstyle="border:0;width=5%;",style="border:0;width=65%;",style="border:0;width=30%;max-width=30% !important;"
idsteps_table
enableSortingfalse
enableHighlightingfalse

Image Added

Configure user defined substitution variables

Div
classtime

Image Added Estimated Time: 1 min

In this step, you will be defining a user defined substitution variable for the Run CLI Actions in JIRA add-on. By defining this information once as a user defined substitution variable, you can re-use it on workflows or the Run CLI Actions screen to tell it how to connect to your HipChat instance.

Log on to your JIRA instance as a JIRA Administrator and do the following:

  1. From the Cog menu (Image Added), choose Add-ons.
  2. In the Run CLI Actions in JIRA section of the left navbar, click Configure. The Configure Run CLI Actions in JIRA screen will be displayed.
  3. Define a new entry with the parameters set as shown to the right.
    1. The Name parameter defines the name of the entry, which you will later reference when running a CLI action from a workflow (as in this recipe) or the Run CLI Actions screen.
    2. The Value parameter defines how to access your HipChat instance.
      1. Replace <URL> with the URL to your HipChat instance.
      2. Replace <TOKEN> with the token of the HipChat user you want to "own" the HipChat room that will be created when a Highest priority ticket is opened.
  4. Click Save to save the user defined substitution variable.

Anchor
step1
step1
User Defined Substitution Variables:

Namehipchat
Value--server <URL>  --token <TOKEN> --autoWait

 

Configure Run CLI Actions in JIRA screen, after defining new variable:

Image Added


Image Added

Create a JIRA project to use with this recipe

Div
classtime

Image Added Estimated Time: 1 min

In this step, you are going to create a project you will use when making and testing the workflow change that creates a HipChat room.

  1. From the Projects menu, choose Create Project.
  2. In the Select Project Type screen, select Simple Issue Tracking and click Next.
  3. The second screen shows the Issue Types that will be used (Task and Sub-task). Click Select.
  4. The third screen prompts you to supply a Name and Key for your new JIRA project.
    1. Use Run CLI Actions in JIRA as the Name.
    2. Use RCAIJ as the Key.
    3. Click Submit to create the project, with you set as its Project Lead.
  5. If you click Create and choose Run CLI Actions in JIRA as the Project and Task as the Issue Type, you will see a Create Issue screen like the one shown to the right. Only 3 fields (Project, Issue Type, and Summary) are required, as indicated by the red asterisk next to their field labels. There are 2 optional fields: Priority and Description. Click Cancel to close this screen.

Anchor
step2
step2
Create Issue screen:

Image Added

 

Expand
titleView all screens for the Create Project wizard...

First screen:

Image Added

Second screen:

Image Added

Third screen:

Image Added


Image Added

Add Assignee to the Create screen

Div
classtime

Image Added Estimated Time: 1 min 

By default, the project is configured to set the default Assignee to "Unassigned." In this step, you will add the Assignee field to the Create screen to ensure it can be input if desired.

  1. From the Cog menu (Image Added), choose Projects.
  2. Click the Run CLI Actions in JIRA link to display the Project Summary page which shows how the project is configured.
  3. In the left navbar, click Screens to go to the Screens page.
  4. Next to the "Create issue" operation, click the RCAIJ: Simple Issue Tracking Create Issue Screen link to open the Configure Screen for this project's Create screen.
  5. In the dropdown at the bottom of the screen, select Assignee.
  6. Click and drag the grab bar to the left of the Assignee field and drag it above the Attachment field. Your screen should now look like the screenshot shown to the right.
  7. Click the Back to project: Run CLI Actions in JIRA button to return to the Screens page.

Anchor
step3
step3
Configure Screen, after adding the Assignee field:

Image Added


Image Added

Create a draft workflow

Div
classtime

Image Added Estimated Time: 1 min 

In this step, you will edit the workflow used by the Run CLI Actions in JIRA project so you can begin the process of adding the Run CLI Actions post function that will create a HipChat room when a Highest priority ticket is opened.

  1. In the left navbar, click Workflows to go to the Workflows screen.
  2. Click the pencil icon (Image Added) in the Operations column next to  the RCAIJ: Simple Issue Tracking Workflow link to edit that workflow.
  3. Click the Text button so that the workflow is shown in Text mode rather than Diagram mode.
  4. Click the To Do link in the Step Name column to display the Step: To Do screen.
  5. Click the Create link shown to the left of the To Do step to open the Transition: Create screen.

Anchor
step4
step4
Step: To Do screen:

Image Added

Transition: Create screen:

Image Added


Image Added

Add a post function on the Create transition

Div
classtime

Image Added Estimated Time: 1 min

In this step, you will add a post function on the Create transition. In a later step, you will configure this post function.

From the Transition: Create screen, do the following:

  1. Click the Post Functions tab to display the post functions. Your screen
  2. Click the Add post function link to display the "Add Post Function To Transition" screen.
  3. Select CLI action and then click Add.
  4. The Add Parameters To Function screen will be displayed.

 

 

 

Anchor
step5
step5
Add Post Function To Transition screen:

Image Added


Image Added

Configure the post function, part 1

Div
classtime

Image Added Estimated Time: 3-4 min

In this step, you will begin configuring the post function you just added to the Create transition so that tickets of the highest priority will trigger the creation of a HipChat room.

From the Add Parameters To Function screen, do the following:

  1. Set the parameters as shown to the right.
    1. Condition 1 indicates that the post function should be executed only when the ticket being created as a Priority = Highest.

      Note
      titleHighest vs. Blocker priorities

      Beginning with JIRA 6.4, the highest priority is now named Highest. In earlier versions, it was named Blocker.

      If you are using a version of JIRA earlier than 6.4, please substitute "Blocker" wherever you see "Highest" in this recipe.

      You might want to view the priority values defined in your instance to ensure you are specifying the correct and exact name. Please note that this name is case sensitive when supplying it in the post function parameters.

    2. Product indicates that HipChat CLI commands will be executed.
    3. Action indicates that the run action will be executed so that multiple commands (as defined in the Data parameter) can be invoked. The Value you provided for the hipchat variable defined on the User Defined Substitution Variables screen in step 1 will be substituted for %variable_hipchat%. The --continue variable is needed to avoid an error in case no Assignee is chosen on the Create screen.
    4. Data defines the commands to be invoked, with each appearing on their own line.
      1. Line 1 creates a new private HipChat room with a name that contains the key of the issue and a description that indicates it is to be used to discuss the ticket.
      2. Line 2 adds the reporter as a member to the new HipChat room and Line 3 adds the assignee as a member of the new HipChat room. For both of these, "@" must be inserted prior to the %original_reporter% substitution variable if the JIRA username matches the @mention name of the HipChat user. This is unnecessary if the JIRA username matches the HipChat username.

        Info

        The Simple Issue Tracking Workflow, by default, uses "Unassigned" as the default Assignee. Because of this, if the user neglects to select an Assignee when creating a new issue, "" (the value after the substitution occurs) will be used as the value for --name. Since this is not a valid name for any HipChat user, Line 3 would error if not for the --continue specified in the Action parameter.

      3. Line 4 writes an initial message to the room to reiterate its purpose to the members and ask that they add others to the room as appropriate.
    5. Notes is an internal comment that serves to document what the post function does.
  2. Click Add to save your changes to the parameters and add the Create Issue post function. You will be returned to the Transition: Create screen.
  3. Your screen should now look like the screenshot shown to the right.

Anchor
step6
step6
Post Function parameters:

Condition 1Image Added
ProductHipChat
Action--action run %variable_hipchat% --continue
Data

Line 1:

--action createRoom --room "%original_key% Room" --topic "Discussion of %original_summary%" --access "private"

Line 2:

--action addRoomMembers --room "%original_key% Room" --name "@%original_reporter%"

Line 3:

--action addRoomMembers --room "%original_key% Room" --name "@%original_assignee%"

Line 4:

--action sendMessage --room "%original_key% Room" --message "This is a private room intended for discussion about this Highest priority issue created on %original_created%: %original_key%. Please add others to this room as appropriate."

NotesThis post function creates a new HipChat room for any new Highest priority ticket so that any conversation about it can be centralized and communicated to interested parties.


Transition: Create screen, after adding the Create Issue post function:

Image Added


Image Added

Configure the post function, part 2

Div
classtime

Image Added Estimated Time: 1 min

In this step, you will complete the configuration of the post function by moving it so that it is executed after the new issue is created. You will then publish the workflow so you can test it.

From the Transition: Create screen, do the following:

  1. Repeatedly click the Down Arrow icon (Image Added) next to the CLI Action post function until the post function is below the "Creates the issue originally" post function. This will ensure the new issue is created before the CLI Action post function is executed.
  2. Your screen should now look like the screenshot shown to the right.
  3. Publish your draft workflow by clicking the Publish Draft button at the top of the screen. The Publish Draft Workflow screen will appear.
  4. When prompted whether to save a backup copy, click Yes and then click Publish.

Anchor
step7
step7
Transition: Create screen, after moving the CLI Action post function:

Image Added

Expand
titleView the Publish Draft Workflow screen...

Image Added 


Image Added

Test the post function, part 1

Div
classtime

Image Added Estimated Time: 2-3 min

In this step, you will verify the post function is working as intended when assigning the newly created issue to a specific user.

  1. Click the Create button to create a new issue. The Create Issue screen will appear.
  2. Fill in the fields as shown on the right and click Create. A popup window similar to the one shown on the right will appear to confirm the issue was created.
  3. Log on to HipChat as the user whose token was specified in the User Defined Substitution Variables in step 1, go into the new room, and you should see a screen like the first screenshot shown to the right.
  4. Log on to HipChat as the same user who created the issue (the Reporter). You should be able to see the room, looking similar to the second screenshot shown to the right.
  5. Log on to HipChat as the same user to whom the issue was assigned (the Assignee). You should also be able to see the room shown in the second screenshot to the right.

 

Anchor
step8
step8
Create Issue fields:

ProjectRun CLI Actions in JIRA (RCAIJ)
Issue TypeTask
SummarySystem crash due to xxx
PriorityHighest
Assignee<Select some other user defined in your JIRA and HipChat instances>


Popup confirmation screen:

Image Added

HipChat Room created for the new issue (Admin's view):

Image Added

HipChat Room created for the new issue (Participant's view):

Image Added


Image Added

Test the post function, part 2

Div
classtime

Image Added Estimated Time: 2-3 min

In this step, you will verify the post function is working as intended when not specifying an Assignee for the newly created issue.

  1. Click the Create button to create a new issue. The Create Issue screen will appear.
  2. Fill in the fields as shown on the right and click Create. A popup window similar to the one shown on the right will appear to confirm the issue was created.
  3. Log on to HipChat as the user whose token was specified in the User Defined Substitution Variables in step 1, go into the new room, and you should see a screen like the first screenshot shown to the right.
  4. Log on to HipChat as the same user who created the issue (the Reporter). You should be able to see the room, looking similar to the second screenshot shown to the right.

With this approach demonstrated in this recipe, you are able to ensure your highest priority issues are effectively resolved, with all interested parties kept informed!

 

Anchor
step9
step9
Create Issue fields:

ProjectRun CLI Actions in JIRA (RCAIJ)
Issue TypeTask
SummarySystem is non-responsive
PriorityHighest
Assignee<Leave set to Automatic>


HipChat Room created for the new issue (Admin's view):

Image Added

HipChat Room created for the new issue (Reporter's view):

Image Added

Include Page
_RecipeTemplateFooter
_RecipeTemplateFooter