Post-function Script in create transition not returning linked issue

IT January 29, 2024

Hi,

we have one post-fumction script in (incident-Issue Type workflow in In-progress transition) to create issue with issue-type "Test" & link both ways when Incident is moved to inprogress  it is successfully  creating issue but in Test worflow in create transition it is not returing the linked issue(Ideally it should return Incident issue ). not working

 

2 answers

0 votes
IT February 3, 2024
I'm using this to create and link issue . It is successfully creating issue & linking 
But when in Test workflow in create transition when  I'm trying to get linked issue it returning empty (null)
import com.atlassian.jira.issue.Issue
import com.atlassian.jira.issue.MutableIssue
import com.atlassian.jira.bc.issue.IssueService
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.IssueInputParameters
import com.atlassian.jira.user.ApplicationUser



def project=ComponentAccessor.getProjectManager().getProjectObjByKey(''INC')
def user=ComponentAccessor.jiraAuthenticationContext.loggedInUser
MutableIssue issue =ComponentAccessor.issueFactory.issue
issue.projectObject=project
issue.summary=" test"
//return project.getIssueTypes()*.id
issue.issueTypeId=101
def newIssue =ComponentAccessor.issueManager.createIssueObject(user,issue)

 

return issue
def issue1 = ComponentAccessor.issueManager.getIssueByCurrentKey('INC-123')
//ComponentAccessor.issueLinkManager.createIssueLink(issue.getId(),issue1.getId(),Long.parseLong("10220"),Long.valueOf(1),user)
newIssue.link('IN',issue1)
issue1.link('OUT',newIssue)



Nic Brough -Adaptavist-
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 7, 2024

What is the error, and what line is it reporting it on?

0 votes
Nic Brough -Adaptavist-
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 29, 2024

Hi IT,

We'll need to see the script and the errors it is logging when it fails.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events