Issue Collector: copy/update field on submit

Alan October 12, 2017

I have a collector with hidden custom fields. I'd like to set this fields with the same values of visible fields in the collector when the user submits the form, is this somehow possible?

I'd like to duplicate the email and name fields contents in particular.

 

1 answer

0 votes
Lenard Lee
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
November 15, 2017

Hi Alan, 

You could try to use a post function to "Copy value from other field" during the creation of the issue. 

FYI, you may need to look into some plugins to get this particular post function. One example of a plugin that provides this is the JSU plugin.

Regards,
Lenard

Alan November 15, 2017

On deeper investigation it turns out that email and name (included by default in the collector if the user is not logged in) are actually not kept as fields but get added to the description field in the created issue. Is there a way to alter this behaviour so that the values get either assigned to respective fields or copied to new fields directly?

To me it looks like there is a kind of default post function for that, maybe it can be leveraged to obtain the desired behaviour? Where to look for that?

Thanks,

Alan

Lenard Lee
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
November 15, 2017

Hmmm... now it would seem that post functions would not be able to do this as the "Name" and "Emails" are not selectable options in the particular post function.

 

I'm not so sure regarding altering the behavior from "adding to the description field" to "map values to custom fields".

 

Looking further into the documentation at Advanced use of the jira issue collector, you could try setting values for the hidden custom fields via the use of JavaScript. In this case, the hidden custom fields are not visible to the user, but is assigned a value based on the JavaScript function when user submits the form.

Alan November 15, 2017

I already tried setting the values via js but this is done only when the collector is loaded and not when it is about to be submitted. If there would be a js function that could be specified to execute when submiting the problem would be solved I guess.

The problem is that the contents of the email and name cannot be set when the collector loads since they have to be provided by the user, then copied to the hidden ones (used in a workflow)

Suggest an answer

Log in or Sign up to answer