Project Estimation using a grid

The Project Estimation use case help user to create default rows in a grid to list the project phases, especially for organization who want to estimate projects phases using Table Grid app, with any kind of Project Management methodology (Agile or others) and also familiar with using Jira.

You will also learn how to use several features in TGNG app such as:

 

Introduction

The Project Estimation use case help user to create default rows in a grid to list the project phases, especially for organization who want to estimate projects phases using Table Grid app, with any kind of Project Management methodology (Agile or others ) and also familiar with using Jira.

The total estimation can then be copied to Time Tracking field (Original Estimate field) in Jira using Java APIs.

Prerequisites

  • User logged into their account, installed Table Grid Next Generation App

  • User created a related Jira project

  • User had the admin role on Jira 

Post-condition

  • User can use the grid to update related information for the list of items

  • User can create issues using the Project Estimate grid

  • User can download/upload the Configuration for personal usage

  • User can add more columns or default rows to support the project estimation such as: Stakeholders, DateTime,…  

Conditions

  • Required fields are marked with a red asterisk *

  • The grid must contain at least one column

  • The grid can be displayed in more than one project

  • User can download/upload the config for future usage in other project/issues.

  • When adding new columns or save the configuration, user need to reindex JIRA in order to changes to take effect.

  • When clicking the box Cell value required, user need to fill the information in the cell.

Flow chart diagram

Creating Project Estimation configuration

Basic Flow

Action

Action

1

Click Add Grid

image-20240516-015518.png
2

Fill information for “Name”

  • Name = Project Estimate

3

In “Scopes”, select your Projects and Issue Types on which you want to display the grid

image-20240527-074650.png
4

In Add Column, choose Sequence in Column type

5

User fill information for Identifier and Title

In this example, writer used “jno“ as Identifier and type “No” as column Title

6

Click Add to save the information 

7

Click Add new column to create new column

8

In Add Column, choose String in Column type

9

User fill information for Identifier and Title

Type “jphase“ as Identifier and type “Project Phase” as Title

Tick the box Cell value required to make sure default value to be used in each cell of column.

 

10

Click Add to save the information 

11

In Add Column, choose Number in Column type

12

User fill information for Identifier and Title

In this example, writer typed “jestimate“ as Identifier and type “Estimation (in hours)” as Title

Tick the box Cell value required to make sure default value to be used in each cell of column.

In Aggregation operation, click button to choose sum option which calculate the sum of the column.

13

Click Add to save the column information 

14

In Add Column, choose String  in Column type

Type “jnote” as Identifier and Type the “Note” as column Title

15

Click Add to save the information 

16

User click image-20240527-075241.png button to add row in the grid

17

Based on your individual purpose, you can fill information for each column by double click the cell.

For example, writer used: “Planning, Specification, Design, Development, Test, Review, Release and Documentation” for Project Phase column.

Click Save button to save the config.

Exceptional Flow

Users click “Cancel” when saving the config

Continued from step #17 in the Basic Flow:

Step

Description

18

The system shows a pop-up message: “Exit without saving?”

19

User click Yes button

Use case stops. 

Use the Project Estimation grid in a Jira Project

  1. Open your issue

  2. Click Grid button to open Project Estimate grid

  3. Click image-20240527-081910.png button to edit the grid

  4. Fill estimate time (in hours) in the grid

  5. Click image-20240527-082049.png to save the grid
    You can view the total estimate time

Going further using TGNG REST APIs

After estimation being done using the grid, we can copy the project estimation total column from the Project Estimation grid to Original Estimate field in Jira Time Tracking feature.
You will need to use an external app like https://marketplace.atlassian.com/apps/6820/scriptrunner-for-jira?tab=overview&hosting=datacenter for scripting in Jira to be able to use TGNG REST APIs.

This script can be used during a transition workflow once the estimation of all phases are Done.
You can use the Custom script post-function feature from ScriptRunner app: https://docs.adaptavist.com/sr4js/latest/features/workflows/post-functions/custom-post-functions

Edit your project’s Workflow

 

  1. Navigate to Workflows, click image-20240527-082830.png button on your project, select Edit

  2. Click on Done

  3. In Post Functions tab, click on Add post function

     

  4. Choose ScriptRunner Post-Function, then click on Add

     

  5. Choose Run Script

  6. Write the below script in Condition:

Read more in to know how to take the Grid ID and Cloud Authorization String

import groovy.json.JsonSlurper; // Specify the issue key to update String issueKey = issue.key String gridId = "..." //Change the grid ID to relevant one String authorizationStringCloud = "Basic ..." //Change the Cloud authorization string to relevant one String baseURL = "https://databuckets.net/rest/tgc/api/v1/grids/" + gridId + "/issue/" + issueKey; def responseData StringBuilder responseError = new StringBuilder() // Getting the Grid information from the Jira Cloud instance try { URL url; url = new URL(baseURL); URLConnection connection = url.openConnection(); connection.setRequestMethod("GET") connection.setRequestProperty("Authorization", authorizationStringCloud) connection.doOutput = true connection.setRequestProperty("Content-Type", "application/json;charset=UTF-8") connection.connect(); int responseCode = connection.getResponseCode() if(responseCode != 200){ responseError.append(connection.getErrorStream().text) return responseError; }else{ String response = connection.getInputStream().getText() def jsonSlurper = new JsonSlurper() responseData = jsonSlurper.parseText(response) } } catch(java.io.IOException ex) { responseError.append("!! exception !!"); return responseError; } // Calculate the total estimation double totalEstimation = 0.00 def rows = responseData.rows if (rows != null) { responseData.rows.each { row -> def estimate = row.columns.get("jestimate") if (estimate != null) totalEstimation += estimate.doubleValue() } } else { responseError.append("Field \"rows\" does not exist in response!"); return responseError; } // Update field "Original estimate" of issue def result = put("/rest/api/2/issue/${issueKey}") .header('Content-Type', 'application/json') .body([ update: [ timetracking: [ [ edit: [ originalEstimate: totalEstimation.toString() + "h" ] ] ] ] ]).asString() // Validate the issue updated correctly if (result.status == 204) { return "Success - The issue with the key of ${issueKey} has been updated with a new original estimation: ${totalEstimation}h" } else { return "${result.status}: ${result.body}" }
  1. Click Add to add parameters to function

Final result on the issue view

When the issue status is “To Do”: the Original Estimate field in Jira isn’t updated with the Total from the estimation column in the grid.

Result: After using a transition to the status Done, Original Estimate field in Jira is updated with the Total from the estimation column in the grid.