Setting Elements Connect JIRA Field with ConfiForms
Asked by Brian Karst:

There are a few fields that are pulling from a database that I don't quite understand how to set via ConfiForms. They type is "Elements Connect (formerly nFeed) (nFeed) - Live - Text" The field autofills when creating an issue from within JIRA or updating the issue from JIRA, but will not from ConfiForms.


Answers:
author: Nicolas Esteves
body: Hi [@Brian Karst](/t5/user/viewprofilepage/user-id/3877643) , [@Alex Medved _ConfiForms_](/t5/user/viewprofilepage/user-id/781630) ,

I'm Nicolas, from the Elements team.

Firstly, I must say that I don't know very well ConfiForms so, my answers might need some adjustments.

Then, before going further, I'd like to get more information about your setup. Can you please illustrate your issue with some screenshots for example? And let me know how you integrated your Elements Connect field into ConfiForms? That would help me to try to reproduce your use case on my side.

If ConfiForms uses the public Jira REST API to get access or set custom field values, then that might explain the issue. Indeed, this API is not able to do everything...

(i) To better understand the following points, the concept of Key with Elements Connect should be known: <https://doc.elements-apps.com/elements-connect/latest/administration-guide/configuration/field-configuration/field-query-configuration#id-.Fieldqueryconfigurationv6.1-Key>

- Here is how to **set a value** (a valid Key) with REST: <https://doc.elements-apps.com/elements-connect/latest/api-guide/rest-api#id-.RESTAPIv6.0-JiraRESTAPI>

- Now, here is how to **get a value** (the Template) with REST: <https://app.swaggerhub.com/apis-docs/bgts/elements-connect/2.0>

- Finally, here is how to **get possible values** for a field with REST: <https://docs.atlassian.com/software/jira/docs/api/REST/latest/#api/2/jql/autocompletedata-getFieldAutoCompleteForQueryString>

I hope that helps.

Kind regards,

comments: author: Alex Medved _ConfiForms_
body: The question here is how to set a particular field.

My understanding after reading this page <https://doc.elements-apps.com/elements-connect/latest/api-guide/rest-api#id-.RESTAPIv6.0-JiraRESTAPI> you use a "standard custom field" which can be updates/set via standard Jira REST API.

It is a matter of knowing the IDs of the options your field has, right?


author: Nicolas Esteves
body: Indeed, if you want to set an Elements Connect field value with a REST call, you need to use the Jira REST API, and especially the "issue" method with a PUT.

Source: <https://docs.atlassian.com/software/jira/docs/api/REST/latest/#api/2/issue-editIssue>

Example: <https://developer.atlassian.com/server/jira/platform/jira-rest-api-example-edit-issues-6291632/>

For an Elements Connect field, you can push any value (*there is no control on the value* ), **BUT** , you need to make sure the value you set is a **valid Key** according to the configuration of the field.
> It is a matter of knowing the IDs of the options your field has, right?

So, the answer is yes!


author: Brian Karst
body: [@Nicolas Esteves](/t5/user/viewprofilepage/user-id/81307) [@Alex Medved _ConfiForms_](/t5/user/viewprofilepage/user-id/781630)

Alex, always thank you for your quick responses.

Nicolas,

Unfortunately I can't post screen shots or illustrate it much better. Quite frustrating but I need to be vague on my end because of information sensitivity in my organization (Alex has had to deal with my vague unspecific questions for a while now). I am inquiring into the database the fields pull from to find out more about what is being sent.

Ideally I would like the ConfiForm to send whatever the field is pulling from the database based upon the user assigned to reporter/requestor etc.

I have the custom field #s but was at a loss for what to put in for the input, through inspecting the page while acting like I am creating an issue in JIRA I did find it seeming to send this in the code.

{"inputValues":\["###XX"\]} with the numbers and characters replaced obviously.

I am going to play with sending some things and see if I can get it to send something, even if it isn't the right thing


author: Brian Karst
body: After some testing....

The Elements Connect field I am playing with expects an Array of Strings.

"customfield_#####": \["string"\],

The above code successfully sent the wrong string to the field and it accepted it. Attempting to edit the field through JIRA resulted in it automatically setting the database string. So my next step would be figuring out how to have it set the Database value without editing the issue in JIRA. Any thoughts [@Nicolas Esteves](/t5/user/viewprofilepage/user-id/81307) [@Alex Medved _ConfiForms_](/t5/user/viewprofilepage/user-id/781630) ?


author: Alex Medved _ConfiForms_
body: [@Brian Karst](/t5/user/viewprofilepage/user-id/3877643)

As [@Nicolas Esteves](/t5/user/viewprofilepage/user-id/81307) has mentioned earlier.. you need to send valid values. I dont know what more can I add here...


author: Alex Medved _ConfiForms_
body: ConfiForms app integration with Jira is on REST API level.

So, you have to know what is the format accepted/expected by the field when set/updated via the REST API

I suggest you ask the vendors of the Elements Connect plugin about the format expected when such field is to be updated via REST API

Knowing that will help you to craft the mapping in ConfiForms


Tags: cloud

confiforms