You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
Next: Root
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
The Atlassian Community can help you and your team get more value out of Atlassian products and practices.
I have followed previous instructions on performing a reindex in my listener after copying values from a parent to a linked issue. The reindex works, but I am hoping to figure out and clear the static check error if possible.
import com.atlassian.jira.issue.IssueManager
import com.atlassian.jira.issue.MutableIssue
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.link.IssueLink
import com.atlassian.jira.issue.link.IssueLinkType
import com.atlassian.jira.issue.IssueFieldConstants
import com.atlassian.jira.issue.link.IssueLinkManager
import com.atlassian.jira.issue.fields.IssueLinksSystemField
import com.atlassian.jira.event.type.EventDispatchOption
import com.atlassian.jira.user.ApplicationUser
import com.atlassian.jira.project.version.Version
import com.atlassian.jira.issue.index.IssueIndexingService
import com.atlassian.jira.util.ImportUtils
ApplicationUser currentUser = ComponentAccessor.getJiraAuthenticationContext().loggedInUser
IssueIndexingService indexing = (IssueIndexingService) ComponentAccessor.getComponent(IssueIndexingService.class)
def reIndexIssue(issue){
//Re-index the issue after update
boolean wasIndexing = ImportUtils.isIndexIssues()
ImportUtils.setIndexIssues(true)
IssueIndexingService.reIndex(issue)
ImportUtils.setIndexIssues(wasIndexing) }
Even though this works and reindex happens, am I being to nit picky trying to clean up this error?
Hi @Casey Hinkle I understand you, but you are using groovy language which allows you for example to not to define types of the variables, so the source code is simpler.
If you want to solve this static check error, you have to set "issue" as an instance of com.atlassian.jira.issue.Issue:
import com.atlassian.jira.issue.IssueManager
import com.atlassian.jira.issue.Issue
import com.atlassian.jira.issue.MutableIssue
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.link.IssueLink
import com.atlassian.jira.issue.link.IssueLinkType
import com.atlassian.jira.issue.IssueFieldConstants
import com.atlassian.jira.issue.link.IssueLinkManager
import com.atlassian.jira.issue.fields.IssueLinksSystemField
import com.atlassian.jira.event.type.EventDispatchOption
import com.atlassian.jira.user.ApplicationUser
import com.atlassian.jira.project.version.Version
import com.atlassian.jira.issue.index.IssueIndexingService
import com.atlassian.jira.util.ImportUtils
ApplicationUser currentUser = ComponentAccessor.getJiraAuthenticationContext().loggedInUser
IssueIndexingService indexing = (IssueIndexingService) ComponentAccessor.getComponent(IssueIndexingService.class)
def reIndexIssue(Issue issue){
//Re-index the issue after update
boolean wasIndexing = ImportUtils.isIndexIssues()
ImportUtils.setIndexIssues(true)
IssueIndexingService.reIndex(issue)
ImportUtils.setIndexIssues(wasIndexing) }
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hey @Martin Bayer _MoroSystems_ s_r_o__
I've added the same script and it doesn't work for me, my error is: "Non static method .......... cannot be called from static context"
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Can you post a screenshot so I can see on what row the error is displayed?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Martin Bayer _MoroSystems_ s_r_o__
Never mind I've managed to work this out.
I'll be glad with your help with this problem I have-
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.