Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

can't edit workflows after adjusting the xml in the database

Deleted user April 8, 2013

I had a problem with my workflows: I removed a plugin that was used by many validators. this broke many workflows. I did a direct DB update, removing the validators that had to do with the plugin.

All the transitions started working fine, but whenever i try to edit a workflow through the UI i get a stacktrace.

I deleted the cache directory and the work directory, but it did't help. Any Ideas/thoughts?

7 answers

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

0 votes
Deleted user June 18, 2014

I can't remember how I ended up solving this. But I don't think I got this method working. I'm still convinced there was some other copy or reference to the workflow that I missed. If I would need to solve this problem today, I'd set up full SQL dump on the JIRA, and see what it does when you change a workflow.

M Hoogenboom June 18, 2014

Thanks. I noticed btw that in JIRA 6.2 it is much more easy to change a workflow scheme and apply this to all the projects using that scheme, so it costs much less effort than with JIRA 5.3.

0 votes
M Hoogenboom June 15, 2014

Gregory, did you get this working in the end? I'm considering the same action as we have one function within a plugin that will be replaced with exactly the same function (same function name) in another plugin and a lot of workflows are using this function in the post conditions of a tremendous amount of transitions. So, it is a lot of work to do this manually for each workflow.

Thanks, Mariska.

0 votes
Matt Doar
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 8, 2013

Glad to hear it. I usually edit XML by exporting it from the Workflow Admin page, and make the change to remove the validator there. If the change to make isn't clear, export the workflow, remove the validator, export again, do a diff. It's usually just removing a entire XML element. Then check that the SQL update command is doing only what you think it is. I find SQL and newlines can make it harder to use than XML and an editor, but I have done it in the past.

0 votes
Deleted user April 8, 2013

Hi Matt,

Thanks for your advice. Of course I did all the changes in a development enviroment :)

I did it while exploring different solutions to the problem i'm facing: how to remove the unwanted validators.

you think something's wrong with the XML? Idunno..

The XML is pretty straight forward. I've looked at it side by side with the old one.. looks very straight forward.

Also, transitions work fine.

I think it's got to do with JIRA maybe holding some kind of cached data somewhere ..? for example, where does it hold the image of the workplan layout?

0 votes
Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 8, 2013

I hate to be the bearer of bad news, but you shouldn't have changed the workflows in the database. Clearing caches and so-on isn't going to help much, the problem is that you've damaged the workflows and Jira can't cope with them.

Your options are

1. Create new workflows and migrate all the issues to them, then delete the damaged ones

2. Undo your database changes in the database

3. Work out exactly how the changes to your workflows have broken it and correct those

In cases 2 and 3, you will probably have to put the validator plugin back in after repairing the workflows, then go through and edit the validator out of the workflows before removing it again.

One other thing you might try - spin up a completely clean and empty Jira and point it at the database. But I suspect you might have exactly the same errors.

Deleted user April 8, 2013

Hi Nic.

What do you mean that I've damaged the workflow? The XML looks pretty straight forwad. I just removed the tags that refers to the validator. Do you know if JIRA holds some additional workflow data besides the XML in the DB?

Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 8, 2013

I mean that the error you are seeing is happening because the edit you have made to the workflow xml is not valid, and Jira can no longer understand what is in there.

There is workflow related data in the database, but it's all issue based, so that is a dead end. I'm not so sure about caches, but the best way to test that is to run a completely clean Jira and point it at your database. What does that do?

I know the xml looks quite simple (compared with the horrors of xml I've seen in the past, I agree that it's simple. Doesn't make it any less dramatic when one apparently tiny error creeps in...), but how do you know your edits are valid? Did you test every edit by doing it in the UI on a copy of the workflow and then scanning the xml to see that you've not missed anything?

I can think of several cases where removing a single tag would "damage" the workflow enough for Jira to choke on it. One in particular springs to mind here...

0 votes
Matt Doar
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 8, 2013

I'd restore the database backup you likely took before doing this. Modifying the production database is fraught with risks. Otherwise export the XML and try to parse it to see what extra text was accidentally removed.

0 votes
Deleted user April 8, 2013

the stacktrace

(stacktrace.txt)

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

TAGS
AUG Leaders

Atlassian Community Events