Power Scripts™ for Jira Hello World Tutorial

Once you have installed Power Scripts™ for Jira, there is no better way to get started than writing a simple "Hello World" program.
We will assume that you already have a project and a workflow associated with it in your Jira installation. If you don't, please refer to Jira documentation on how to do that. 

Contents

Required apps


1. Adding a SIL Post Function

  1. Create a new transition under the In Progress step and enter a name for it, for example "Say Hello!". 
  2. In the Destination Step combo box, select "In progress".
    Your transition should look like this:


    Click Add.
     
  3. You should now be back to the View workflow steps page. 
  4. Find your newly created transition and click it. 
  5. Add a new postfunction (conditions and validators are added the same way, under their respective tabs).
    To do this, under the Post Functions tab, click Add and select (k) SIL™ Post-function.



2. Writing the code

After you have added the post function, you are now ready to write the actual code. Now give your program an appropriate name. This will be used as a base for the name of the file where the program will be saved (See Installation & Configuration for more information).

  1. To specify the issue description and summary to be "Hello world!" for instance, write the following code:

    summary = "Hello world!";
    description = summary;
  2. Click the Add button and you are ready to test your program.


Note

Though it is not necessary here, it is recommended that you move all SIL™ Post Functions after all other post functions. You can do that by repeatedly clicking Move Down until it is at the very bottom of the post functions list.

3. Testing the code

Next, activate your draft workflow by publishing it.

  1. Open an existing issue or create a new one. 
  2. Advance through the workflow to the In Progress step. If you have created a new issue, all you have to do is click Start Progress.
    You can now see the newly created transition "Say Hello!".



  3. Click Say Hello to execute it.
    After you execute it, the issue will look like this:

It works!

See also