createIssueLink (Long sourceIssueId, Long destinationIssueId, Long issueLinkTypeId, Long sequence, User remoteUser)


Cananybody help me out figuring what parameters do i need to pass in?

Suppose i have 2 issues with me say Mutable issue as "issue" and other as "opt"

so now what i need to pass?

2 answers

0 votes

You need to pass in:

  • The id of the first issue (mutable issue)
  • The id of the second issue (opt)
  • The id of the type of link you want to create
  • The number of the link you want to create (if an issue has 7 links already, you want to pass in "8" here)
  • The object representing the user who is creating the link

I got the point for SourceIssue ID, Destination Issue ID, User. but id of the type of link is what i am stuck, so can you elaborate on it?

My code seems like this.












































Sorry nic, code didint get attached. okay that value i got it from database.

Here is my code:


def public TransitionStatus(MutableIssue issue)

{


def cfopts = issue.getCustomFieldValue(customField_name)
def MutableIssue opt = issueManager.getIssueObject(cfopts)

log.warn("get OPT name: " + opt.key)


def currentUser = jiraAuthenticationContext.getUser();


Collection<ActionDescriptor> actions1 = issueWorkflowManager.getAvailableActions(issue);
log.warn("Action for Candidate Tickets are: " + actions1)
log.warn("Open Position :" + opt.dump())
log.warn("Open Position Class : " + opt.getClass())
log.warn("Current Status for open position" + opt.getStatusObject())

def jiraworkflow = workflowManager.getWorkflow((Issue)opt) as JiraWorkflow;

def transitions = jiraworkflow.getAllActions()

def status=jiraworkflow.getLinkedStatusObjects()


WorkflowTransitionUtil workflowTransitionUtil = ( WorkflowTransitionUtil ) JiraUtils.loadComponent( WorkflowTransitionUtilImpl.class ); //This will capture the Wokflow
workflowTransitionUtil.setIssue(issue); //This will set the Issue
workflowTransitionUtil.setAction(221);//This will set the Action Id to Make an Offer Transition
workflowTransitionUtil.progress(); //This will vallidate the progress
log.warn("I have set the Status Transition have performed from Second Round to Make an Offer!!")

WorkflowTransitionUtil workflowTransitionUtil1 = ( WorkflowTransitionUtil ) JiraUtils.loadComponent( WorkflowTransitionUtilImpl.class );
workflowTransitionUtil.setIssue(opt); //This will set the Issue
workflowTransitionUtil.setAction(11); //This will set the Action Id Candidate Joined Transition
workflowTransitionUtil.progress(); //This will vallidate the progress
log.warn("I have set the Status Transition have performed from Pending to Candidate Joined for OPen Position !!")

}

TransitionStatus(issue)

I can't see any code there, but I can try to explain the link type id.

If you, as an administrator, go into "issue linking" in the web interface, you'll see a list of link *types*. For example "related", "cloned", "dependent on" and so-on. You need to pass in the ID of the link type you wish to use.

To find the link type id, go to Administration > System > Issue Linking. Here you will see your Jira instance's link types. Each will have an "Edit" and "Delete" operation hyperlink. Mouse over these hyperlinks and you will see the link type id at the end of the URL.

For example https://yourserver/secure/admin/EditLinkType!default.jspa?id=10020

The id=10020 indicates the link type id is 10020.

Suggest an answer

Log in or Join to answer
Community showcase
Sarah Schuster
Posted Jan 29, 2018 in Jira

What are common themes you've seen across successful & failed Jira Software implementations?

Hey everyone! My name is Sarah Schuster, and I'm a Customer Success Manager in Atlassian specializing in Jira Software Cloud. Over the next few weeks I will be posting discussion topics (8 total) to ...

2,760 views 11 18
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot