Hi Team,
I'm new to Script runner..
Please consider two issues, Issue-1 and Issue-2, which has security levels, "SecurityLevelA" and "SecurityLevelB" respectively.
From Issue-1 when I select More->Link and mention Issue-2 and then link it.
I wanted the security level of Issue-2 to be changed from "SecurityLevelB" to "SecurityLevelA"
I would like to use "IssueLinkCreatedEvent" in listener.
Kindly let me know how this can be achieved.
please find below my code, i suppose it's not right. Kindly help me in getting the code right,
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.Issue
import com.atlassian.jira.issue.security.IssueSecurityLevelManager
import com.atlassian.jira.issue.security.IssueSecuritySchemeManager
import com.atlassian.jira.issue.link.IssueLinkManager
def issueSecuritySchemeManager = ComponentAccessor.getComponent(IssueSecuritySchemeManager)
def issueSecurityLevelManager = ComponentAccessor.issueSecurityLevelManager
IssueLinkManager issueLinkManager = ComponentAccessor.getIssueLinkManager()
def issue = event.issue as Issue
List<IssueLink> l_linkedissue = issueLinkManager.getOutwardLinks(issue)
def l_securitylevel = issueSecurityLevelManager.getSecurityLevel(issue.getGenericValue())
l_linkedissue.setSecurityLevel (secLevelGv)
l_linkedissue.store()
Regards
Rajakumar Sivakumar
rajakumar.s@hcl.com
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.