Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import com.atlassian.jira.component.ComponentAccessor;
- import com.atlassian.jira.issue.*;
- import com.atlassian.jira.event.type.EventDispatchOption;
- import com.atlassian.jira.issue.index.IssueIndexingService
- import com.atlassian.jira.util.ImportUtils
- def issueManager = ComponentAccessor.getIssueManager();
- def IssueSecurityLevelManager = ComponentAccessor.getIssueSecurityLevelManager()
- def currentUser = ComponentAccessor.getJiraAuthenticationContext().getLoggedInUser()
- def issueIndexingService = ComponentAccessor.getComponent(IssueIndexingService)
- def wasIndexing = ImportUtils.isIndexIssues()
- String s="";
- int count = 0;
- for(int x=180;x<=250;x++){
- s = "ITHELPDESK-116"+x.toString();
- Issue issue = issueManager.getIssueObject(s);
- if(issue){
- issue.setSecurityLevelId(10400L)
- issueManager.updateIssue(currentUser,issue,EventDispatchOption.DO_NOT_DISPATCH,false)
- ImportUtils.setIndexIssues(true);
- issueIndexingService.reIndex(issue);
- ImportUtils.setIndexIssues(wasIndexing);
- count+=1;
- }
- }
- return count
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement