how can I create a new issue during a transition in another project and the project is pending on a user field value? e.g. user field = ABC, new issue will be created in project ABC
ComponentAccessor comAcc =new ComponentAccessor(); CustomFieldManager cfm = comAcc.getCustomFieldManager(); currentIssue.getCustomFieldValue(cfm.getCustomFieldObjectByName("user field")); IssueManager issueManager = comAcc.getIssueManager(); IssueFactory issueFactory = comAcc.getIssueFactory(); ProjectManager projManager = comAcc.getProjectManager(); JiraAuthenticationContext authContext = comAcc.getJiraAuthenticationContext(); MutableIssue issueObject = issueFactory.getIssue(); Project projObj = projManager.getProjectObjByKey("{user field i.e.project key}"); issueObject.setProjectId(projObj.getId()); issueObject.setReporterId(authContext.getLoggedInUser().getName()); issueObject.setSummary("[JIRA-generated] "+currentIssue.getSummary()); issueObject.setPriorityObject(currentIssue.getPriorityObject()); issueObject.setIssueTypeId(currentIssue.getIssueTypeObject().getId()); issueManager.updateIssue(authContext.getLoggedInUser(),issueObject,EventDispatchOption.ISSUE_UPDATED,true);
https://developer.atlassian.com/display/JIRADEV/Performing+Issue+Operations
https://answers.atlassian.com/questions/107582/how-to-create-an-issue-programatically-using-java
you go through the above links, if any doubt you can ask me.
you create an issue by placing a condition.
see the code in my answer
Try
https://marketplace.atlassian.com/plugins/org.swift.jira.cot
I'll give it a try, many thanks for now.
It looks like you're new here. Sign in or register to get started.