Create issue with copied multi-user picker custom field (ScriptRunner)

Zoltan Kiss February 16, 2021

Hi,

I have to create a complex solution for our customer but I'm stucked at a part.

The task, is to create a new issue that inherits some data from the original issue, and link the two tickets.

I'm trying to do it with IssueInputParameter, but it's not too flexible in adding CustomFields, cause it only accepts String parameters.

By this way I can't add value to the multi-user picker, th validation result is invalid all the times.

Does anyone knows a better solution?

1 answer

0 votes
Martin Bayer _MoroSystems_ s_r_o__
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 16, 2021

Hi @Zoltan Kiss I remember we used few methods

Zoltan Kiss February 16, 2021

Hi @Martin Bayer _MoroSystems_ s_r_o__

I've already tried the second one, and I'm able to copy it's value. The problem is, that when the new issue is created, an other script has to handle that, but without this custom field value, it will fails all the time.

What I trying to do:
1. create issue (without the custom field value) in a post-function at the original issue and link them together
2. catch the create issue event, and fill this custom field
3. further tasks with new issue in an other post function

It fails at 2. because issue2 is null... As I think, the first point is slower than the second, so at that moment when 2. starts, issue2 is not exists yet. Or the linking is too slow?!
Now I have to create issue2 and then link it to issue1 in the same script.

Is there a way to link issue1 and issue2 at the same time when I create issue2 ?

I've planned trying to clone issue2, but I don't need every field. Can I decide what will issue2 inherits os at least exclude some fields?

Martin Bayer _MoroSystems_ s_r_o__
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 16, 2021

Hi @Zoltan Kiss thank you for clarification. And what about this postfunction prepared by Adaptavist. It already contains link and custom field selection functionality:

https://scriptrunner.adaptavist.com/latest/jira/builtin-scripts.html#_clones_an_issue_and_links

Zoltan Kiss February 16, 2021

Hi @Martin Bayer _MoroSystems_ s_r_o__ ,

Well... I've never used it, but I give it a try.

Thank you.

Suggest an answer

Log in or Sign up to answer