Can I set my summary field based on data from proforma forms?

Someone_Somewhere December 20, 2022

I found code to help me set the description field based on proforma data and with a few changes was able to set the summary field within Scriptrunner's console. However, when I moved the code from the console to a post-function I can't get it to work. Kepp getting null pointer exception for the issue. However I thought script runner post-function automatically have access to the issue. Am I wrong? Have I been staring at the code too long?

1 answer

0 votes
Peter-Dave Sheehan
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.
December 20, 2022

Where in your post function did you put your code?

Is this on the "Create" transition?

And if so, did you put it before the issue have been saved or after?

I don't have access or experience with proforma, but I had a similar issue with the "Bundled Field" from the Extension for JSM plugin.

For me, I was able to fix the issue by moving my post function after the issue save (but then the script has to take care of saving the change and re-indexing).

Someone_Somewhere December 22, 2022

Yes, it's on the "Create" transition. I've tried moving it after the issue save post function but no luck. 

It's partially filling the summary but doesn't seem to be getting the field value data. 

Peter-Dave Sheehan
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.
December 22, 2022

If you put your code after the save, it might be helpful to fetch a fresh issue object using issueManager.getIssueObject(issue.id).

This way, if proforma is somehow adding the info in an asynchronous way to the issue, you will be getting the most recent version of the issue and the proforma data might be available.

Beyond that, I'm not going to be much more help without exact code, logs and access to an env with proforma.

Someone_Somewhere December 22, 2022

I'm using issueManager.updateIssue to update the issue. I have been told it's nice to have and not a requirement so I'll probably sleep on it and hopefully the solution will hit me in my dreams.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events