Trying to get&update Jira ticket data using Confluence Confiforms macro field type
Asked by sunil kumar:

Trying to get Jira fields **statuscategory,Service Name,priority,acceptance,Initial PSS Analysis,Applications Impacted,Country,Acceptance criteria,Application ID** ticket data using ConfiForms Rules for Field Definition' Macro inside i Action to execute:used Lookup and set Jira issue data and i pass values to set in that text field i used reporterCF=fields.reporter.name\&summaryCF=fields.summary\&serviceNameCF=fields.serviceName\&assigneeCF=fields.assignee\&acceptancecriteriaCF=fields.acceptancecriteria\&statuscategory=statusCategory.name\&labels=entry.labels\&country=fields.country i am passing Jira ticket number able to get summary,**Reporter field from JIRA,Assignee but i am unable to fetch data from statuscategory,Service Name,priority,acceptance,Initial PSS Analysis,Applications Impacted,Country,Acceptance criteria,Application ID**

**I used statuscategory Field type: Status,Service Name Field type:text,priority field type:Dropdown,acceptancecriteria: Field type:Text area,PSS Priority Field type:Drop down,affectedservices Field type:Drop down,country field type:Drop down**

**And i am tying to update ticket also using that fields but i am facing below issue.**

* com.atlassian.sal.api.net.ResponseException: Error communicating with Jira, {"errorMessages":\[\],"errors":{"statuscategory":"Field 'statuscategory' cannot be set. It is not on the appropriate screen, or unknown.","acceptance":"Field 'acceptance' cannot be set. It is not on the appropriate screen, or unknown.","serviceName":"Field 'serviceName' cannot be set. It is not on the appropriate screen, or unknown.","affectedservices":"Field 'affectedservices' cannot be set. It is not on the appropriate screen, or unknown."}}

Using the below json to update ticket

```
{    "key": "[entry.keyCF]",            "fields": {                        "project": {                                    "key": "DCDAPROD"                        },                        "summary": "[entry.summaryCF]",                        "description": "Testing Successful",						"serviceName": "[entry.serviceNameCF]",                        "assignee": "[entry.assigneeCF]",                        "affectedservices": "[entry.affectedservicesCF]",                        "acceptance": "[entry.acceptancecriteriaCF]",                        "labels": "[entry.labels]",                        "statuscategory": "[entry.statuscategory]"                                                 }
}
```


Answers:
author: Alex Medved _ConfiForms_
body: Hi

What you ask is more related to how to use Jira REST APIs

And the error you see tells you that there are no such fields on your Jira projects like affectedservices, acceptance and statuscategory

And therefore those cannot be set from ConfiForms or from anywhere else

Alex

comments: author: sunil kumar
body: Hi Alex,

I have used Another jira ticket key to fetch the ticket information data but unable to fetch Acceptance and status and rest all fields, I have a small doubt is i am using correct field type to fetch data from jira??


author: sunil kumar
body: Hi Alex,

After adding all fields to fetch the data from Jira i was facing the below issue.

* Rendering of ConfiForms Form contents has failed: RuntimeException occurred while performing an XHTML storage transformation (null)


author: Alex Medved _ConfiForms_
body: That is because the field names are not correct - there is no such field in Jira as "acceptance". If that is a custom field then it usually has a name that is constructed by "customfield_XXX" where XXX it's ID

We have a helper service that could help you to figure out field's name

<https://wiki.vertuna.com/display/CONFIFORMS/Creating+Jira+issue+from+Confluence+with+ConfiForms>

Or via Atlassian KB's article <https://confluence.atlassian.com/jirakb/how-to-find-id-for-custom-field-s-744522503.html>

Alex


author: sunil kumar
body: Hi Alex,

I am able to populate the jira ticket in confluence page using API i am able to get json values using json fields . But now i am using same confluence page i need to update ticket i jira if i change the field type it was not populating jira ticket data in confluence only if i put fieldtype as a text it was populating. Can you please help me what i need to do using one confluence page i need to get information form jira and i need to post values in jira.


Tags: cloud

confluence-cloud

jira