Forums

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

"affectedVersion is not EMPTY " is not working

Nilufar July 20, 2021

Hi,

If I set Affects versions using edit screen." Project ="XXX" and affectedVersion is not EMPTY " works fine and returns the issue.

But If I used scriptrunner code:

issue.setAffectedVersions(affectedVersion)
issueManager.updateIssue(user, issue, EventDispatchOption.DO_NOT_DISPATCH, false)

to set Affected version, the code works fine and I can see the added Affects versions in view screen. But " Project ="XXX" and affectedVersion is not EMPTY "  does not return the issue.

 

Does someone knows what is the problem ?

 

1 answer

1 accepted

0 votes
Answer accepted
Vikrant Yadav
Community Champion
July 20, 2021

Hi @Nilufar It's definitely an indexing issue. Include below code in Script.

import com.atlassian.jira.issue.index.IssueIndexingService

def indexManager = ComponentAccessor.getComponent(IssueIndexingService.class)
indexManager.reIndex(issue)

 Are you using post function to update Affect version field value ?

Thanks

Nilufar July 20, 2021

No, I am using automation

Vikrant Yadav
Community Champion
July 20, 2021

Automation for JIRA > Action "Run Script" ,something like this  ?

Nilufar July 20, 2021

Thank you @Vikrant Yadav 

It worked fine

Nilufar July 20, 2021

Yes , I run script when event triggered. I updated script and it worked fine

Like Vikrant Yadav likes this
Vikrant Yadav
Community Champion
July 20, 2021

Cool! Glad to hear it works for you!

Stay Safe!

Like Nilufar likes this

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
SERVER
TAGS
AUG Leaders

Atlassian Community Events