Could you clarify the question a little?
Do you simply want to create links between issues with groovy? If so, where are you doing it? A post function?
What has the "query custom issue field" got to do with these links? From what I've seen, the plugin doesn't the have anything to do with issue links, although it duplicates some of the functionality.
but this is not what i am looking for.
Can we create link like:
linkManager.createIssueLink(opt.getStatusObject().getId(),issue.getStatusObject().getId(),issueLinkTypeManager.getIssueLink(issue.id),1 , currentUser)
but in my case i dont know from where to get all the parameter values?
So any help?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
We want to follow which issues found in which test and review sessions. In order to do this we have defined 2 new issue types called “Review Task” and “Test Task”. We have also defined a new relation called “found in”. As a improvement we also do not want to manually link issues found during a test or review to its parent task. To make the process a little bit strait forward we have added a new custom field called “Parent Task ID” to our bug issue type. While creating a bug we just enter the parent task id to this field and a workflow post function automatically links two issues with each other. Also we check validly of parent task id field with another workflow validation script. The only problem is we do not have autocomplete for parent issue id field. Any improvement is welcome.
def parentTaskID = cfValues['Parent Task ID']; if (parentTaskID == null || parentTaskID == '') { return true; } else { def parentIssue = ComponentAccessor.getIssueManager(). getIssueObject(parentTaskID); def isValid = parentIssue != null && parentIssue.projectObject.key == issue.projectObject.key && (parentIssue.issueObject.name == 'Review Task' || parentIssue.issueObject.name == 'Test Task'); return isValid; }
def ComponentManager componentManager = ComponentManager.getInstance(); def customFieldManager = componentManager.getCustomFieldManager(); def parentTaskIDCF = customFieldManager. getCustomFieldObject('customfield_10517');//write your own custom field id here def parentTaskID = issue.getCustomFieldValue(parentTaskIDCF); if (parentTaskID == null || parentTaskID == '') { return true; } else { def issueManager = ComponentAccessor.getIssueManager(); def parentIssue = issueManager.getIssueObject(parentTaskID); def isParentIssueValid = parentIssue != null && parentIssue.projectObject.key == issue.projectObject.key && (parentIssue.issueObject.name == 'Review Task' || parentIssue.issueObject.name == 'Test Task'); if (isParentIssueValid) { def issueLinkManager = ComponentAccessor.getIssueLinkManager(); def issueLinkTypeManager = componentManager. getComponentInstanceOfType(IssueLinkTypeManager.class); def issueLinkType = issueLinkTypeManager. getIssueLinkTypesByName('Found In').get(0); def authenticationContext = componentManager. getComponentInstanceOfType(JiraAuthenticationContext.class); issueLinkManager.createIssueLink( issue.id, parentIssue.id, issueLinkType.id, 1L, authenticationContext.user); } }
fdfafa
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I am able to open the link and thier contains shown above.
Cheers
Onkar Ahire
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Akash,
I found something which you are looking for.
Regards
Onkar Ahire
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.