I'd like to build a custom field that gets populated by a user with a number. Javascript then pulls some data based on that number and populates two other fields that are then also saved to the DB. Those other two fields should be in the same view.
I've done this scenario before successfully without the need to populate other fields based on the input.
What's the best way to approach this?
Community moderators have prevented the ability to post new answers.
I kind of got this working now. I created one field called 'number' to capture the input from the user.
I then created another field called 'name' which runs the below code.
import com.atlassian.jira.ComponentManager; import com.atlassian.jira.issue.fields.CustomField; import com.atlassian.jira.issue.CustomFieldManager; import groovy.json.* CustomFieldManager customFieldManager = ComponentManager.getInstance().getCustomFieldManager(); CustomField number = customFieldManager.getCustomFieldObjectByName("Number Field"); def data = new URL("Https://url.com"+number.getValue(issue)).getText(); def json = new JsonSlurper().parseText(data); return json.name;
For the template I just used 'Text-field'
It works well but I want the 'name' field to update as soon as the 'number' field has been populated. Right now the 'name' field doesn't show until I save the issue.
Any suggestions?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
But how would it pull the data from the web service? The workflow is as follows:
Does your recommendation allow for that functionality?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
In the "Create" transition, put 2 conditions "copy field from value to value"
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Will that allow me to populate the two other fields in the create view as soon as the value of the first field changes?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You can use the JIRA Scripted Custom Fields and update your "Create" transition.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Community moderators have prevented the ability to post new answers.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.