How to display the Status of a Risk in the Risk Table in DC?

In order to display issue state in your Risk Table you will need to do following:

  1. Create one text field to the Risk Table called “Status”. We will start populating issue status values into it.

  2. Create synchronisation logic to keep the field “Status” updated to the current issue status value. You can do that either with an event listener script or by having a workflow post function that updates the “Status” field value.

    1. Event listener - the event listener listens to the system events and if an issue workflow change is detected, then it copies the value of the current status to the field “Status”.

    2. Workflow post function - Each Jira issue has a workflow and it consists of transitions and statuses. Each time a transition is executed, a defined post function is also executed. You can create different post functions to each transition e.g. “update issue field”, “add comment to issue”, etc.

Examples:

CPrime Powerscript event listener:

NB! You need to have Jira global admin permissions to implement this.

1. Let's create a new custom field to the Risk Table:

 

2. The Risk Table looks like this now:

3. Go to the custom fields section to identify the newly created fields id. Navigate to “Custom fields” section and search for your field.

After you have found it, click “Edit”:

When the page is loaded, click on the url bar of your browser to record the id:

The example above shows that my “Status” custom field id is 10322. We will need that id number in the future.

3. Next, we have following workflow in our Risk Management project:

In this process a risk will go through risk assessment after risk identification. Thereafter it is reviewed by a QA team and if all the mitigation actions are defined as needed, then it is approved and mitigated.

 

Next step is about creating the script that updates “Status” field value.

 

4. First, we need to create an empty sil script file in SIL Manager:

5. The created sil script should have only one line: “customfield_10322=key.status;

Save the script! You can also click Check to double-check that all is ok.

More info about SIL post functions at https://confluence.cprime.io/display/TR/Post+Functions

 

6. Now we can add the event listener. For that go to SIL Listeners section.

Select the events that your workflow is publishing. By default you will need the following ones: Issue Created, Issue Updated and Generic Event. To optimize the performance, please create your specific event type and modify the workflow post functions to fire that one!

Also, look for your created script and pick a user who has necessary permissions.

By now, you should have the SIL listener that synchronises the status in the custom field “Status”:

You can also see it when you create an issue or change an existing one:

 

Using workflow post functions to copy status values

You can also execute the written sil script for specific cases in certain workflow transitions. To do that, edit the workflow and add new post function under the selected transition:

Select the SIL Post-function:

Select the script you created before and follow the steps of the wizard to the end:

 

Make sure the newly added post function comes after the “Set issue status to the linked status of the destination workflow step.”. You probably need to shift it down by clicking on arrows on the rows!
NB! If you forget to do that, the issue status will not be updated when the script executes. The reason is that same value will be copied to the field - new status is not just there yet.