Finding imported tickets by externalId

Hello! We imported several thousands tickets (using JSON importer) and would like to be able to find them by their old IDs. During import these were specified as {{externalId}}. For example:

{
                    "externalId": "HLR219",
                    "issueType": "Defect",

                ...

However, when I attempt to search (using JQL):

curl -D- -X GET -H 'Content-Type: application/json' ......./jira/rest/api/2/search\?jql=externalId=HLR219

I get an error:

{"errorMessages":["Field 'externalId' does not exist or you do not have permission to view it."],"errors":{}}

The tickets are all showing their original IDs -- the custom field is named "External issue ID" and was populated by the JSON-importer during import...

If I dump the entire issue, I see these label (such as HLR219) as values of customfield_10801 of each ticket. However, searching for such custom field does not work:

{"errorMessages":["Field 'customfield_10801' does not exist or you do not have permission to view it."],"errors":{}}

2 answers

1 accepted

This widget could not be displayed.
Henning Tietgens Community Champion Nov 21, 2013

In JQL you have to use either the name of the customfield, so this should be "External issue ID", or the ID like this "cf[10801]".

And I guess you would need to use the "~" operator instead of "="

This widget could not be displayed.

Although, it would seem, going directly to the database is both faster and easier -- one does not even need to know the numeric ID of the custom field in advance -- only its value. For example:

select jiraissue.id as id, pkey, assignee, stringvalue
    from jiraissue join customfieldvalue on jiraissue.id=issue
    where stringvalue='HLR219'

Suggest an answer

Log in or Sign up to answer
Atlassian Summit 2018

Meet the community IRL

Atlassian Summit is an excellent opportunity for in-person support, training, and networking.

Learn more
Community showcase
Posted Wednesday in New to Jira

Are you planning to trial, or are currently trialling Jira Software? - We want to talk to you!

Hello! I'm Rayen, a product manager at Atlassian. My team and I are working hard to improve the trial experience for Jira Software Cloud. We are interested in   talking to 20 people planning t...

106 views 2 0
Join discussion

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