Closed GeekTieGuy closed 6 months ago
Almost certainly you defined a status_category_mapping in your config and Jira is also returning a mapping for that status and the categories are different. Try commenting out the "status_category_mapping" to see if it fixes the problem.
If you're on the latest code then it shouldn't care if you still have your own status category mapping so long as it matches what comes back from Jira. There was a bug in earlier code where it might complain even if they were the same, but that was fixed a while back.
Thanks! Here is my config - is there a status_category_mapping I'm not seeing?
Exporter.configure do target_path 'target'
jira_config 'jira.config'
project do
file_prefix 'sample'
download do
rolling_date_count 90
end
board id: 561 do
cycletime do
start_at first_time_in_status_category('In Progress')
stop_at currently_in_status_category('Done')
end
end
file do
file_suffix '.html'
html_report do
story_point_accuracy_chart
end
end
end end
No, I don't see a status_category_mapping at all in there. It does look like you have one too many 'end's at the bottom but that should give you a different error.
I plugged that into my local config (changing the board id only) and it downloaded and generated the report successfully. So I have to assume that there is some bad data in what you currently have downloaded. Can you delete the target directory and do a download again?
Let me try status_category_mapping first - where do I find that in the Wiki?
It appears you've uncovered a bug in the docs. status_category_mapping should be in project configuration and isn't. I'll make a note to fix that.
Basically, you put this declaration inside a project block: status_category_mapping status: 'MyNewStatus', category: 'In Progress'
That's not going to fix your immediate problem though. That fixes a problem where a status has been removed from Jira but the history of changes still references it. The error you have above should only happen when you did a status_category_mapping in a case where you didn't need to, and it was different from what Jira is actually returning.
And just one more question: what is the set of categories? I assume they are "To Do", "In Progress" and "Done". Is that correct?
Yes. In theory, those are the only three possible status categories in any Jira instance. In practice, I've also seen NULL, where the category isn't set. I'm still not sure how that was possible.
Could it be that if I have a slash or ampersand in some of the status fields in Jira, that might throw off a parser somewhere? I have a huge list of statuses in the json that gets generated in the target directory upon download. Not all of them are actually used on my board.
I also see some status entried in the json that say "No Category" for the statusCategory name node.
Assuming that the error you're getting is still the one at the top of this thread then I'd say no.
Redefining status category Status(name="Review", id=11923, category_name="In Progress", category_id=4) with Status(name="Review", id=11659, category_name="To Do", category_id=2).
The status that's causing it grief is called Review and somehow it's trying to redefine the category. Is it possible that you have two statuses in the JSON that are both called Review? That shouldn't be possible but with Jira, we often see things that are theoretically impossible.
There is an interesting node on the "Review" status in question:
"scope": { "type": "PROJECT", "project": { "id": "13739" } }
And yes, there are two "Review" status nodes in the *_statuses.json
When I delete the duplicate Review status that has that extra "scope" node from the json entirely, the jirametrics export command no longer throws an error. And it produces the html too. So I have a good workaround for now. Thanks for the discussion!
I'm looking through the samples I have access to and I can't see a scope declaration anywhere. Are you able to share what flavour (Server, Cloud, Data Center) and version of Jira you're on?
Yes, I'm on a Cloud instance.
I'll re-download and give you an anonymized version of the node in question.
{ "self": "https://snip/rest/api/2/status/11659", "description": "", "iconUrl": "https://snip/", "name": "Review", "untranslatedName": "Review", "id": "11659", "statusCategory": { "self": "https://snip/rest/api/2/statuscategory/2", "id": 2, "key": "new", "colorName": "blue-gray", "name": "To Do" }, "scope": { "type": "PROJECT", "project": { "id": "13739" } } },
You can email mbowler@gargoylesoftware.com if you don't want it in a GitHub ticket btw.
I think it's ok to have it here.
Was the other Review the same, only without the scope?
Yes:
{ "self": "https://snip/rest/api/2/status/11923", "description": "", "iconUrl": "https://snip/images/icons/statuses/generic.png", "name": "Review", "untranslatedName": "Review", "id": "11923", "statusCategory": { "self": "https://snip/rest/api/2/statuscategory/4", "id": 4, "key": "indeterminate", "colorName": "yellow", "name": "In Progress" } },
On the Estimate Accuracy graph (the one I'm most interested in), it says "The aging dots (if you turn them on) show the current age of items[...]" - How does one turn them on (I didn't see it mentioned on the Wiki)?
Just click on the heading in the legend. I see how that wouldn't be obvious. All data sets in all charts can be turned on/off this way.
One of the reasons for the duplicate status is that the board I import from spans multiple projects, I guess.
Thank you again for helping with this. And thank you for creating these tools. They work really well and make my life a lot easier than pulling data myself and doing Excel gymnastics!
I'm looking at the API docs and it appears that a status can now be either global scope or project scope. No idea whether it's been this way all along and I'm only hitting it now or if it's something new. Either way, I now have to figure out how to reproduce this in my test instance. https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-status/#api-rest-api-2-statuses-get
One more, sorry: How does one specify the project name in the config file so that --name will work?
project name: "some_name" do
...
end
I've been adding to the docs for all your questions above btw, so thanks for helping to improve those ;-)
I'm now able to reproduce this error in my test instance of Jira. It happens when there is at least one NextGen (now called team managed) project in the instance and that one redefines a status that was globally set in the Classic projects.
I've also discovered that NextGen projects don't have board ids at all, which means this doesn't work at all for them. One problem at a time though.
I've pushed version 1.3 of jirametrics which should allow you to do a download and export without hand-tweaking the status file. I'm going to close this ticket but if this doesn't fix it for you then let me know.
I was able to reproduce the problem locally and the fix works for me.
I reinstalled today, got version 1.3, and ran a configuration that used to cause trouble. No trouble this time around. All good! Thank you!!!
I have a custom workflow in Jira, and jirametrics can successfully download the data, but when it comes to generating just one html report (the story point accuracy one), and I run 'jirametrics export' to avoid redownloading the data, I get this message:
Redefining status category Status(name="Review", id=11923, category_name="In Progress", category_id=4) with Status(name="Review", id=11659, category_name="To Do", category_id=2). Was one set in the config?
What do I do to get around this?