Import Data into Labels Field

I'm trying to populate a custom Label field in one of my projects with about 200 values. The list contains information about the systems in this project, hence the lengthy list.

I tried it with JSON following the suggestions here:

https://confluence.atlassian.com/pages/viewpage.action?pageId=314449019

and here:

https://confluence.atlassian.com/display/JIRA/Importing+Data+from+JSON#ImportingDatafromJSON-CustomFields

But my imports keep failing. It looks as if the import is expecting a Summary field. The JSON format does indeed include the "customFieldValues" section inside the "Issues" section. It's as if it's trying to import a issues and populate them with the Labels.

I need to do the opposite. That is, I need to pre-populate the Labels field so that when users start entering issues, the values are already there.

I also tried importing the list using CSV, but again a summary field is required.

Is there any way to pre-populate the Labels field so that when users start entering issues, the values are already there?

I don't think creating 200 bogus issues and deleting them is a practical approach.

 

FWIW, here are he JSON imports I tried:

Attempt 1:

{

 

    "projects": [

        {

            "key": "TPHELP",

            "issues": [

                {

                    "customFieldValues": [

                        {

                            "fieldName": "Service Tag",

                            "fieldType": "com.atlassian.jira.plugin.system.customfieldtypes:labels",

                            "value": "1FM3PC1"

                        },

                        {

                            "fieldName": "Service Tag",

                            "fieldType": "com.atlassian.jira.plugin.system.customfieldtypes:labels",

                            "value": "1GRBQW1"

                        },

                        {

                            "fieldName": "Service Tag",

                            "fieldType": "com.atlassian.jira.plugin.system.customfieldtypes:labels",

                            "value": "1GS8QW1"

                        }

                    ]                   

                }

            ]

        }

    ]

}

 

Attempt 2:

"customFieldValues": [

                        {

                            "fieldName": "Service Tag",

                            "fieldType": "com.atlassian.jira.plugin.system.customfieldtypes:labels",

                            "value": "1FM3PC1"

                        },

                        {

                            "fieldName": "Service Tag",

                            "fieldType": "com.atlassian.jira.plugin.system.customfieldtypes:labels",

                            "value": "1GRBQW1"

                        },

                        {

                            "fieldName": "Service Tag",

                            "fieldType": "com.atlassian.jira.plugin.system.customfieldtypes:labels",

                            "value": "1GS8QW1"

                        }

]

 

3 answers

0 votes

That is not how the labels field works - it does not have a pre-set list of options, its suggestions are based on what users have previously added.  In other words, you have to have some issues with your desired labels already added before it can start to make any suggestions.  The importers only import issues.

Nic, thanks for the response. I hope I'm not interpreting your statement that the importers only import issues. The importers also import users, projects, and specific values for projects. I've used JSON importers to import the components for a specific project for example. Your reference may have been specifically within the context of issues, but I wanted to clarify in case it helps someone else.

In my case, I ended up copying and pasting the values into the Label field of a test issue that I had in this project. Fortunately this field type allows for multi-value entries and you can just copy and paste. So even with a few hundred labels, I was able to just copy and paste.

 

I interpreted this question as "I want the auto-complete in the labels field to already guide my users to one of about 200 existing entries."  I actually had a custom label-style field called "Customer" and had a similar need.

My goal was to create a single "dummy" issue that had all the customers on it, so that any subsequent time someone creates an issue the typeahead assists with the names of the actual customers and I don't get my users making up their own abbreviations.

If you use CSV import, with a column for each customer, it works.  So my file looks something like:

 

Issue Type,Summary,Custom field (Customer),Custom field (Customer),Custom field (Customer)
Task,Dummy issue,Acme-Products,Baker-Manufacturing,Canadian-Government

 

...then use the CSV importer and it will allow you to map that field to my Customer field, and I get a single issue with all my customers in it.

 

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Nov 27, 2018 in Portfolio for Jira

Introducing a new planning experience in Portfolio for Jira (Server/DC)

In the past, Portfolio for Jira required a high degree of detail–foresight that was unrealistic for many businesses to   have–in   order to produce a reliable long-term roadmap. We're tur...

2,672 views 18 21
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