How to create a Jira issue using IFTTT where the Jira field has a forward slash
Asked by Joseph Jandal:

I am using Confluence Confiforms IFTTT macro to create a JIRA issue. My problem is a custom field in Jira that has a "/" slash in the field name (ie. component/s) I can't figure out how to include this field slash in the macro. Everything I tried generates an error becasue of the slash. I have tried escaping using \<esc\>/ but that doesn't work either.


Answers:
author: Joseph Jandal
body: Alex, thank you.

However, still not working...getting this error:

* com.atlassian.sal.api.net.ResponseException: Error communicating with Jira, {"errorMessages":\[\],"errors":{"components":"expected Object"}}

Here's my code:

{  
"fields": {  
"project":  
{  
"key": "MPAS"  
},  
"summary": "\[entry.Summary\]",  
"description": "\[entry.Description.escapeJSON\]",  
"labels": \["ProjectIntakeRequest.escapeJSON"\],  
"components": \["Stardust"\],  
"issuetype": {  
"name": "Story"  
}  
}  
}

comments: author: Alex Medved _ConfiForms_
body: Please have a look at the answer I have linked earlier - <https://community.atlassian.com/t5/Answers-Developer-Questions/How-to-set-components-in-Jira-REST-API-5-x-while-creating-a/qaq-p/529155>

It is all there - you are setting the field incorrectly...

Should be

```
"components": [{"name":"Stardust"}]
```


author: Joseph Jandal
body: I need to mention also that the custom field 'Component/s' is already define in the story screen. So error message is confusing.

comments: author: Alex Medved _ConfiForms_
body: It is not confusing really, as it tells you that this field is not on the screen - and this means it is either incorrectly referenced or missing indeed.

See my previous comment - in your case it is incorrectly referenced in the mapping

Should be "components"


author: Joseph Jandal
body: The slash is in the No Format section of the IFTTT:

{ "fields": { "project": { "key": "MPAS" }, "summary": "\[entry.Summary\]", "description": "\[entry.Description.escapeJSON\]", "labels": \["ProjectIntakeRequest.escapeJSON"\], "Component/s": \["Stardust"\], "issuetype": { "name": "Story" } } }

Here's the error I get:

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


author: Alex Medved _ConfiForms_
body: Hi

Where do you have and need for a forward slash? In JSON mapping between Jira and ConfiForms?

Alex

comments: author: Alex Medved _ConfiForms_
body: Components are not set by "name", but as every other field in the JSON mapping it needs to be set by internal name.. which is "components"

See also some other answer on this <https://community.atlassian.com/t5/Answers-Developer-Questions/How-to-set-components-in-Jira-REST-API-5-x-while-creating-a/qaq-p/529155>


author: Joseph Jandal
body: Please show me how the syntax would be in the No Format below:

"labels": \["ProjectIntakeRequest.escapeJSON"\],

"Component/s": \["Stardust"\],

where I am assigning the field Component/s a value of "Stardust"


author: Alex Medved _ConfiForms_
body: I think you still misunderstand what I am saying... instead of

```
"Component/s": ["Stardust"],
```

you need to put

```
"components": ["Stardust"],
```


author: Joseph Jandal
body: I guess I am still not getting it or not communicating properly. In my case,++our custom field name is 'Component/s'++ which is a really bad name since component is also a keyword in Jira.

So, how do I reference this field 'Component/s' in my Jira story creation from ConfiForms? I need to assign it a ++value++ of "Stardust".


author: Alex Medved _ConfiForms_
body: If this is a custom field then it should have an internal name in a way like

customfield_XXX

where XXX is the number assigned to it by Jira when you have created it. and you should use this (internal) name in the mapping (not the label "Component/s" or whatever else you may have as a file label).

Jira expects an **internal** field name for this field


Tags: cloud

confiforms

confluence-cloud