Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How to pop up a dialog box when issue is flagged?

Justin Princehorn
November 11, 2022

Hi,

My ultimate goal is to help find easy way to 1.  identify blocked issues, 2. track how long issues are blocked and 3. decipher what type of blocker is it.

I think I have found a solution for #1 and #2 by using the Flag feature and using some combination of automation rules and custom fields like Blocked_Start_Time and Blocked_End_Time and Blocked_Total_Time.

My question for #3 above though is, is there a way to configure a dialog box to pop up on the screen whenever a user sets the Flag on an issue, which would then prompt the user to fill in the Blocker Type field value (assuming this would be a new custom field) with a drop down pre-defined list of values such as "Need Requirements", "External Team", "Environment issue" etc...

1 answer

1 accepted

0 votes
Answer accepted
Alexey Matveev
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Champions.
June 20, 2018

Hello,

It should be like this:

import java.text.SimpleDateFormat

import java.sql.Timestamp
import java.text.DateFormat
import java.util.Date
Collection versions = issue.getFixVersions()
if (versions==null || versions.size()!=1)
return null
def version = versions.iterator().next()
SimpleDateFormat DATE_FORMAT = new SimpleDateFormat("dd-MM-yyyy");

DATE_FORMAT.format(new Date(version.releaseDate.time);
Aisha M
Contributor
June 20, 2018

@Alexey Matveev Hi Alexey. Thank you for the response.

For the last line, getting the error pop up as 'unexpected token' and the script returns no value

Alexey Matveev
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Champions.
June 20, 2018
import java.text.SimpleDateFormat

import java.sql.Timestamp
import java.text.DateFormat
import java.util.Date
Collection versions = issue.getFixVersions()
if (versions==null || versions.size()!=1)
return null
def version = versions.iterator().next()
SimpleDateFormat DATE_FORMAT = new SimpleDateFormat("dd-MM-yyyy");

return DATE_FORMAT.format(new Date(version.releaseDate.time));
Aisha M
Contributor
June 20, 2018

@Alexey Matveev

Getting this error, 

Script Fields java.lang.Exception: The search indexer: class com.atlassian.jira.issue.customfields.searchers.DateTimeRangeSearcher expected your script to return a java.util.Date, but it returned an java.lang.String. We couldn't convert it to a java.util.Date

 

How to fix this ? Please help

Alexey Matveev
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Champions.
June 20, 2018

The problem is that your searcher is com.atlassian.jira.issue.customfields.searchers.DateTimeRangeSearcher. You can change it to the free text. 

Also have a look at this thread

https://community.atlassian.com/t5/Adaptavist-questions/Date-format-for-script-field/qaq-p/698130

 

Aisha M
Contributor
June 21, 2018

@Alexey Matveev

The thread you shared was perfect ! Fixed it using the Custom template. Thank you so much.

Alexey Matveev
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Champions.
June 21, 2018

You are welcome!

Suggest an answer

Log in or Sign up to answer