Update Custom Field (nFeed type)

ISONE June 12, 2015

We have 2 fields, customer name and customer id, which are from other source.  If customer logs into our system and create ticket, we will not display their customer name and id, instead, populate the 2 fields by using data from the session within the post functions of Create Draft.  I have searched dozen "solutions", but none of  them works.  Any help is really appreciated!

4 answers

0 votes
ISONE June 12, 2015

I used Script Runner in post function.  Found the following example, but I can't find where to import WebAppsCf

 
 def customerFieldName = "customfield_11000"
  
  
  CustomFieldManager customFieldManager = componentManager.getCustomFieldManager()
  CustomField customField = customFieldManager.getCustomFieldObject(customerFieldName);
  
  Options options = WebAppsCf.getOptions(null, customField.getRelevantConfig(issue), null);
  
  Option newOption = options.getOptionById(customer);
  
  ModifiedValue mVal = new ModifiedValue(issue.getCustomFieldValue(customField), newOption );
  
  customField.updateValue(null, issue, mVal, new DefaultIssueChangeHolder());

 

 

Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
June 12, 2015

I don't know what webappscf even is.

0 votes
Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
June 12, 2015

Ok, you'll need some code to do that.  I'd do it with the behaviours stuff in the Script runner for JIRA, and a script on the post-function that sets a value when the field is left empty by customers.

0 votes
ISONE June 12, 2015

If our Admin logs in, I will display the drop down list from nFeed.  For our customer, I want to just set the value without them to select.

 

Thank you so much for looking the issue!

0 votes
Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
June 12, 2015

I don't understand the question.  

You've got an nFeed field (which draws data from an external database).  You have a user who logs in and creates an issue.  I guess they are seeing the nfeed field but I don't understand what you are trying to do after this point.

Suggest an answer

Log in or Sign up to answer