How to set nFeed customfield programatically

Hi all,

We are working in a JIRA replication project, where two remote instances should be continously synchronized.

Then, I need to set a nFeed customfield in a post-function using a Groovy code.

I am using a code like this, but does not work, raising the error below:

customerValue = "ABC CONS MET ASSES E MERC S/A - SAO PAULO - BRAZIL" //Sample value
cfCustomer = customFieldManager.getCustomFieldObject(10601) //nFeed Customer field
cfCustomer.updateValue(null, missue, new ModifiedValue(null, customerValue ), new DefaultIssueChangeHolder())

The error raised is:

2013-03-06 09:15:30,744 http-bio-9081-exec-9 ERROR 2208.1 555x25241x1 i8yokm 200.150.176.119,127.0.0.1 /secure/QuickCreateIssue.jspa [plugins.sql.customfield.SQLFeedCustomFieldType] Unexpected value 'ABC CONS MET ASSES E MERC S/A - SAO PAULO - BRAZIL'
2013-03-06 09:15:30,745 http-bio-9081-exec-9 ERROR 2208.1 555x25241x1 i8yokm 200.150.176.119,127.0.0.1 /secure/QuickCreateIssue.jspa [plugins.sql.customfield.SQLFeedCustomFieldType] Invalid data type 'ABC CONS MET ASSES E MERC S/A - SAO PAULO - BRAZIL' while creating changelog string


I think this very strange, since this value is exactly the same used where the field is showed in the issue view.

We tried use the primary key in the "customerValue" (like 1234), but the error remains.

There are some documentation or tip about this issue ?

1 answer

1 accepted

Hi all, with support of Valiantys (https://jira.valiantys.com/browse/SQLFEED-521) the solution is:

customerValue = "ABC CONS MET ASSES E MERC S/A - SAO PAULO - BRAZIL" //Sample value
cfCustomer = customFieldManager.getCustomFieldObject(10601) //nFeed Customer field
nFeedContent = missue.getCustomFieldValue(cfCustomer)
nFeedContent.clear()
nFeedContent.add(customerValue)

cfCustomer.updateValue(null, missue, new ModifiedValue(null, customerValue ), new DefaultIssueChangeHolder())

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Bridget Sauer
Published Thursday in Marketplace Apps

Calling all developers––You're invited to Atlas Camp 2018

 Atlas Camp   is our developer event which will take place in Barcelona, Spain  from the 6th -7th of   September . This is a great opportunity to meet other developers and get n...

96 views 0 5
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you