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 vote

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 Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Amir Kazemi
Posted 3 hours ago in Jira

We want to know what Jira Service Desk apps you're using!

Hi Community! My name is Amir and I’m on the Jira Service Desk product marketing team at Atlassian. Our team would love to understand how you’re leveraging our ecosystem for Jira Service Desk. Wha...

16 views 0 4
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