No delete option on Screens
Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.
Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.
*Except Fisheye and Crucible
Symptoms
Browsing to Administration >Issues > Screens there is no option to delete a screen, even if it was just created. In the logs the following error appear:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
2013-12-19 13:24:50,513 http-bio-8080-exec-3 ERROR user 404x1557x1 4s34af 127.0.0.1 /secure/admin/ViewFieldScreens.jspa [webwork.util.ValueStack] METHOD: "deletable", exception:
java.lang.IllegalArgumentException: Unknown workflow view 'ScreenName', or cannot find attribute 'jira.fieldscreen.id' for workflow action '1'.
at com.atlassian.jira.workflow.WorkflowActionsBean.getFieldScreenForView(WorkflowActionsBean.java:75)
at com.atlassian.jira.workflow.AbstractJiraWorkflow.loadFieldScreenActions(AbstractJiraWorkflow.java:474)
at com.atlassian.jira.workflow.AbstractJiraWorkflow.getActionsForScreen(AbstractJiraWorkflow.java:458)
at com.atlassian.jira.web.action.admin.issuefields.screens.ViewFieldScreens.hasWorkflowsIncludingDrafts(ViewFieldScreens.java:176)
at com.atlassian.jira.web.action.admin.issuefields.screens.ViewFieldScreens.isDeletable(ViewFieldScreens.java:197)
at sun.reflect.GeneratedMethodAccessor378.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at webwork.util.InjectionUtils$DefaultInjectionImpl.invoke(InjectionUtils.java:70)
at webwork.util.InjectionUtils.invoke(InjectionUtils.java:56)
at webwork.util.ValueStack.findValue(ValueStack.java:517)
at webwork.util.SimpleTest.test(SimpleTest.java:408)
at webwork.util.ValueStack.test(ValueStack.java:157)
at webwork.view.taglib.IfTag.doStartTag(IfTag.java:40)
at org.apache.jsp.secure.admin.views.issuefields.screens.viewfieldscreens_jsp._jspx_meth_ww_005fif_005f6(viewfieldscreens_jsp.java:2505)
at org.apache.jsp.secure.admin.views.issuefields.screens.viewfieldscreens_jsp._jspService(viewfieldscreens_jsp.java:364)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:432)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
Cause
It happens because the attribute jira.fieldscreen.id
is missing from the workflow - perhaps this screen was deleted.
Resolution 1
Go through Using the Database Integrity Checker first to see if this helps. If not:
Verify if those screens exist the database. It's likely they were somehow deleted:
1 2 3
SELECT * FROM fieldscreen ORDER BY 2;
ℹ️ If these have been deleted, they can be restored by restoring the entire instance using the XML backup. They cannot be restored by themselves through the application.
You need to find in which Workflow this error is from. This can be done by identifying the workflow with those screen names in it. Replace 'Default Screen' with the screen name from the exception(s).
1 2 3
SELECT workflowname FROM jiraworkflows WHERE descriptor LIKE '%Default Screen%';
Export that workflow to XML. This is done by viewing the workflow and clicking Export > XML.
Search the XML for the screen name, e.g.: 'Default Screen':
1 2 3 4
<action id="500" name="Go to Resolved" view="Default Screen"> <meta name="jira.description"></meta> <meta name="jira.fieldscreen.id">1</meta> <results>
Change the
jira.fieldscreen.id
to a valid value from step 1, for example:1 2 3 4
<action id="500" name="Go to Resolved" view="Default Screen"> <meta name="jira.description"></meta> <meta name="jira.fieldscreen.id">10000</meta> <results>
Backup the database (using XML or native DB tools).
Import that edited workflow XML.
Resolution 2
Alternatively, if you cannot import the workflow or if there are too many workflows to be modified, you can use the following operation that will change the workflows directly in the database. This was only tested in JIRA 7.
This operation relies on database manipulations. 'Resolution 1' is safer and should be used if possible. If you decide to use this resolution, please, take a database backup before doing any changes.
Also, this resolution requires a 'Linux' system, as the script used won't work in Windows (if you're running JIRA in a Windows system, just copy the 'descriptors' file generated in step 1 to a Linux system and proceed from there.
This will replace all non-existing references to screens to a single screen you'll create.
Copy the result of the following 'select' to a file named 'descriptors.xml'
1
select descriptor from jiraworkflows;
There are different commands in different databases. The following command works for 'postgres':
1
copy ( select descriptor from jiraworkflows ) to '/path/descriptors.xml';
Make sure you have the 'descriptors' file in a Linux system
Make sure the file has new lines (not the '\n' characters) in XML file. Depending on how the data is copied, each descriptor may be in a single line. If so, this may resolve it:
1 2
cat descriptors.xml | sed -r -e 's/\\n/\n/g' > descriptors_fixed.xml mv descriptors_fixed.xml descriptors.xml
Create a new screen in Screens page in JIRA without any fields and take note of its ID in the URL
Copy the following script to a script file (say fix_workflows.sh) in the same directory as 'descriptors.xml', replacing <NEW_ID>, by the screen's ID
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
#!/bin/bash # Change here! NEW_SCREEN_ID=<NEW_ID> FILE=descriptors.xml SEARCH_STRING='<meta name="jira.fieldscreen.id">' cat $FILE | grep "$SEARCH_STRING" | sort | uniq | while read line; do ID=`echo $line | cut -d '>' -f 2 | cut -d '<' -f 1` echo -e "\033[0;31m If the following select doesn't return anything\033[0m, run the update below it. \033[0;31mDon't run in otherwise\033[0m" echo "select * from fieldscreen where id = $ID;" echo "update jiraworkflows set descriptor = replace(descriptor,'<meta name=\"jira.fieldscreen.id\">${ID}</meta>', '<meta name=\"jira.fieldscreen.id\">${NEW_SCREEN_ID}</meta>');" echo done
Give it executable permissions:
1
chmod a+x fix_workflows.sh
Run it
1
./fix_workflows.sh
Stop JIRA and backup the database
Follow the instructions, run the updated only if the select above it doesn't return anything. This will change only the references to non-existing screens.
Start JIRA
Was this helpful?