Invalid data after using script runner to clone an issue as a post-function in JIRA workflow

Jeannette Lamb May 15, 2013

After raising this question, https://answers.atlassian.com/questions/170553/how-to-manage-transition-of-support-issues-to-the-product-backlog-in-jira, I used the built in script to clone an issue if the resolution = "Entered into Product Backlog". It successfully clones the issue and sets the status in the new project to "New" which is correct but it appears to now have invalidated or corrupted existing data in the project. A query in the issue navigator to return all issues in the project where status=new returns invalid results. The newly cloned issues are not returned but 1007 issues which are actually not in status = new are returned. Please Help!

7 answers

1 accepted

0 votes
Answer accepted
Jeannette Lamb May 16, 2013

Thanks for your suggestion Danial. Strangely, the issue appeared to have corrected itself a few hours later. An issue search for items where status = New returned the correct 50 records instead of a random 1007 records. As a precaution, we still went ahead with the reindex. All seems ok today. My only concern is that this will happen again when I run the script runner post-function again.

AhmadDanial
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
May 21, 2013

Hey there, Jeanette.

You are welcome. Glad to know that the issue is fixed on your side now. Perhaps Jamie will be able to help if you hit into the same problem after running the post-function again.

Warm regards,

Danial

JamieA
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.
May 21, 2013

Most likely Jeanette actually assigned a new value to the statusObject.name, when she meant to compare. This will cause weirdness like this.

0 votes
JamieA
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.
May 17, 2013

cfValues['Severity'] = "Level 1/Critical"

This is also wrong. Should be ==.

0 votes
JamieA
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.
May 17, 2013
issue.priority = '1'
That's not valid, see my answer on your other question about this.
0 votes
JamieA
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.
May 17, 2013

Also can you post any code you have attached to this function, either or both of the "condition" and "additional code"

0 votes
Jeannette Lamb May 16, 2013
This is the latest I've tried.  The condition works but setting the priority doesn't.
Condition:
issue.resolution?.name == 'Entered into Product Backlog'
cfValues['Severity'] = "Level 1/Critical"

Additional Issue Actions:

issue.priority = '1'

The invalid results issue seems to have been resolved.

0 votes
JamieA
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.
May 16, 2013

> The newly cloned issues are not returned but 1007 issues which are actually not in status = new are returned

There's no way it's going to modify 1007 issues - sounds like something else is screwed up. Maybe indexing is broken... as Ahmad says, reindex.

0 votes
AhmadDanial
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
May 16, 2013

Hey there, Jeannette.

Since you suspect that there might be some invalidated / corrupted data in the project, have you tried to reindex your instance? More over, you can also clear off the outdated / corrupted cache in your instance just to see if it helps (You can backup your instance first if you are concerned that you might hit into any other problems along the way)

  • Shutdown JIRA instance
  • Delete the contents of JIRA Installation Directory\work directory
  • Delete the contents of JIRA Home Directory\caches\indexes\comments directory
  • Delete the contents of JIRA Home Directory\caches\indexes\entities directory
  • Delete the contents of JIRA Home Directory\caches\indexes\issues directory
  • Restart JIRA instance
  • Perform re-indexing

Hope this helps.

Warm regards,

Danial

Suggest an answer

Log in or Sign up to answer