rankBeforeIssue

I’m am able to create a new issues using the Jira API with my local hosted server.

Now all excited, it’s time for me to deploy the real McCoy and it look like I’ll be meeting the deadline just in time.

But oh no. When I try the same using the cloud server, I get an error:

key='rankBeforeIssue', reason='expected Object

The post request:

POST https://europeana.atlassian.net/rest/api/2/issue 
payload = 
{
  :create=>{}, 
  :fields=> {
    :project=>{:id=>"10500"}, 
    :summary=>"...", 
    :issuetype=>{:id=>"10100"}, 
    :assignee=>{:name=>nil}, 
    :reporter=>{:name=>"unknown.user"}, 
    :priority=>{:name=>"Medium"}, 
    :labels=>["assembla"], 
    :description=>"...", 
    :customfield_10601=>"1", 
    :customfield_10603=>"Environment & Architecture", 
    :customfield_10602=>"Done", 
    :customfield_10605=>"7270983", 
    :customfield_10700=>"2015-02-05", 
    :customfield_10104=>"-2.0", 
    :customfield_10607=>nil, 
    :customfield_10105=>0
  }
}
=> NOK (key='rankBeforeIssue', reason='expected Object')

PLEASE help, what can I do to get past this?

I cannot find any information about the rankBeforeIssue key, what is going wrong?

Hi @kiffin.gish,

What is returned when you make a request to the issue/createmeta endpoint?

Both cloud and hosted are identical, except hosted works fine and cloud chokes with above message.

{
    "expand": "projects",
    "projects": [
        {
            "self": "https://europeana.atlassian.net/rest/api/2/project/10501",
            "id": "10501",
            "key": "EC",
            "name": "Europeana Collections",
            "avatarUrls": {
                "48x48": "https://europeana.atlassian.net/secure/projectavatar?avatarId=10324",
                "24x24": "https://europeana.atlassian.net/secure/projectavatar?size=small&avatarId=10324",
                "16x16": "https://europeana.atlassian.net/secure/projectavatar?size=xsmall&avatarId=10324",
                "32x32": "https://europeana.atlassian.net/secure/projectavatar?size=medium&avatarId=10324"
            },
            "issuetypes": [
                {
                    "self": "https://europeana.atlassian.net/rest/api/2/issuetype/10101",
                    "id": "10101",
                    "description": "A task that needs to be done.",
                    "iconUrl": "https://europeana.atlassian.net/secure/viewavatar?size=xsmall&avatarId=10318&avatarType=issuetype",
                    "name": "Task",
                    "subtask": false
                },
                {
                    "self": "https://europeana.atlassian.net/rest/api/2/issuetype/10102",
                    "id": "10102",
                    "description": "The sub-task of the issue",
                    "iconUrl": "https://europeana.atlassian.net/secure/viewavatar?size=xsmall&avatarId=10316&avatarType=issuetype",
                    "name": "Sub-task",
                    "subtask": true
                },
                {
                    "self": "https://europeana.atlassian.net/rest/api/2/issuetype/10100",
                    "id": "10100",
                    "description": "A user story. Created by JIRA Software - do not edit or delete.",
                    "iconUrl": "https://europeana.atlassian.net/images/icons/issuetypes/story.svg",
                    "name": "Story",
                    "subtask": false
                },
                {
                    "self": "https://europeana.atlassian.net/rest/api/2/issuetype/10103",
                    "id": "10103",
                    "description": "A problem which impairs or prevents the functions of the product.",
                    "iconUrl": "https://europeana.atlassian.net/secure/viewavatar?size=xsmall&avatarId=10303&avatarType=issuetype",
                    "name": "Bug",
                    "subtask": false
                },
                {
                    "self": "https://europeana.atlassian.net/rest/api/2/issuetype/10000",
                    "id": "10000",
                    "description": "A big user story that needs to be broken down. Created by JIRA Software - do not edit or delete.",
                    "iconUrl": "https://europeana.atlassian.net/images/icons/issuetypes/epic.svg",
                    "name": "Epic",
                    "subtask": false
                },
                {
                    "self": "https://europeana.atlassian.net/rest/api/2/issuetype/10200",
                    "id": "10200",
                    "description": "Research, design, investigation, exploration, and/or prototyping needed to gain the knowledge.",
                    "iconUrl": "https://europeana.atlassian.net/secure/viewavatar?size=xsmall&avatarId=10311&avatarType=issuetype",
                    "name": "Spike",
                    "subtask": false
                }
            ]
        }
    ]
}

Hi @kiffin.gish, did you figure out what went wrong? I’m also getting the rankBeforeIssue error (though I haven’t tried running on multiple servers).

Thanks in advance!

Found this other thread suggesting to remove the custom fields and it worked for me!

@kiffin.gish,

I think one of your custom field has type Rank. Note that ranking value is auto generated when the issue is created and you must not set value of field having such type. Such fields have some different purpose to serve. To check what type of custom fields you have, you can hit following API from browser,

https://europeana.atlassian.net/rest/api/2/field

Search for Rank in the response and identify the field id (i.e. customfield_XXXXX). Just remove that field from your request and verify. Do this for similar other fields if any.

Hope this helps.

Thanks.

1 Like