CSV Import - How to set Elements Connect field when creating issues from a CSV file
Need
You want to import issues from a CSV file.
In this file, a column stores values of an Elements Connect field:
Summary | Element Connect field |
---|---|
Hello world | 10001 |
Salut le monde | 10002 |
Ola el mundo | 10003 |
Solution
Preconditions
An elements connect field must be configured
The value of the elements Connect field in the CSV file must be a valid key.
How to
Single value fields
If the Elements Connect field is a single value field, you can simply write the key in the CSV file.
Let's say the values you want to import are:
10000
10001
10002
The CSV file would be:
summary,connect field
hello world,10000
salut le monde,10001
ola el mundo,10002
Multi values fields
If the Elements Connect field is a multi values field, you must enclose the field keys in a JSON object:
{
"inputValues":["10000","10003"]
}
the CSV file would be
summary,connect field
hello world,"{""inputValues"":[""10000"",""10001""]}"
salut le monde,"{""inputValues"":[""10002"",""10003""]}"
ola el mundo,"{""inputValues"":[""10004"",""10005""]}"
Please note that we have use the " char to wrap the field value and thus the " chars in the file are escape with " char (the result is a double ": "")
If you're not sure if the Connect field is a single or multi values fields, you can use the JSON syntax for single values fields too