Forums

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

Date of First Transition error

AV April 4, 2019

Hi.

I need to use Date of First Transition but get error 
The indexer for this field expects a <b>java.util.Date</b> but the script returned a <b>java.sql.Timestamp</b>.

Where i can find source of this script  to fix it?

2 answers

0 votes
PD Sheehan
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 Leaders.
April 5, 2019

I don't think the source is available for this field.

But I have no problem with it. 

My guess is that your version of scriptrunner is not compatible with your version of jira. 

You could use a custom scripted field instead of the build-in scripted field.

Here is a starting point:

import com.atlassian.jira.component.ComponentAccessor
def changeItems = ComponentAccessor.changeHistoryManager.getChangeItemsForField(issue, 'status')
if(changeItems){
return changeItems.first().created
} else {
return null
}
0 votes
Antoine Berry
Community Champion
April 5, 2019

Hi,

Not sure what you are trying to accomplish with what date and how you are getting the value, but Jira indeed uses java.sql.Timestamp format, so you might need to convert its type.

Antoine

AV April 5, 2019

This is scriptrunner built-in script. I don't know where it's source placed.

Antoine Berry
Community Champion
April 5, 2019

Are you writing a script ? What are you trying to do with it ?

AV April 5, 2019

Not. This is a built-in script that sets the value of customfield by the date of the first transition to the status. Now this script does not work due to data type mismatch. If I had found the script source, I would correct the error.

Antoine Berry
Community Champion
April 8, 2019

Well as far as I know script runner scripts are either directly written in Jira's interface or are stored on the server. So I guess it is on the server in your case ? 

Providing a screenshot would be helpful.

Alexander Verzakov
Contributor
April 10, 2019

field type error.pngSo question maybe can be closed. I create custom script.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events