I have this code
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.link.IssueLinkManager
import org.apache.log4j.Category
import com.atlassian.jira.issue.link.IssueLink
import com.opensymphony.workflow.InvalidInputException
IssueLinkManager linkMgr = ComponentAccessor.getIssueLinkManager()
for (IssueLink link in linkMgr.getOutwardLinks(issue.id)) {
log.debug("linked issue type: " + link.issueLinkType.name)
log.debug("linked issue key: " + link.getSourceObject().getKey())
log.debug("linked issue status (name): " + link.getSourceObject().getStatus().getName())
log.debug("linked issue status (id): " + link.getSourceObject().getStatus().getId())
if (!link.getSourceObject().getStatus().getName().contains("Verified")) {
log.debug("issue " + link.getSourceObject().getKey() + " is not in Active state")
invalidInputException = new InvalidInputException("Linked issue is not in a status of Template")
throw invalidInputException
}
}
here,.. it should check all the linked issues are in verified state and then change the status of the issue.
All i get is invalid error exception : null.
could anyone please help???/
I am guessing the exception trace shows the exception is occurring in the for loop condition. (It is a good idea to get the stack trace whenever an exception occurs because it helps with debugging)
You could try this instead as your for loop condition
for(linkMgr.getLinkCollectionOverrideSecurity(<issuekey>).getAllIssues())
Hey shivaram,
Try the below code in your validator
int count=issue.getLinkedIssues("Includes").size()
int status
issue.getLinkedIssues('Includes').each{
if(it.getStatus().getName()="Verified")
{status++}
}
if(count==0||count==status){
return true}
else{return false}
I hope this is what your are looking for.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Aditya Sastry
where the issue from?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.