I would like to set a default SUMMARY value for certain request types.
I found info here, stating to insert this javascript into the field. The instructions are:
Go to the respective Field Configuration of the project.
Find for the Summary field.
Click on Edit.
Input the following JavaScript at the Description of the field:
<script type="text/javascript">
if (document.getElementById("summary").value == "") {
document.getElementById("summary").value = "<Default Value for Summary>\n";}
</script>
But I gather this will affect this field in all forms, etc. Is that correct?
I read elsewhere that I could add,
if (issue.get("issuetype").name == "Issue Type" {
But actually even without this additional code, the above JS doesn't have any affect on the new issue form (on the user portal). And on the Agent site of things, I shows the JS under the field, as its description.
Is there any way (without using paid plugins/add-ons to achieve this?
Hi,
For the customer portal you can set a default value and hide it too.
Regarding your main enquiry, make sure the Enable HTML in field descriptions and list item values is on in your instance (at least for Server/DC) and then it will populate.
I would also suggest to add an && clause to your example
<script type="text/javascript">
if (document.getElementById("summary").value == "") && (issue.getAsString("issuetype").name == "Issue Type") {
document.getElementById("summary").value = "<default Value for Summary>\n";}
</script>
You may need to play a bit with the code, sorry I'm pretty bad at coding
Hello @inspirednz
Thank you for reaching out.
I see that you are currently subscribed to Jira Cloud. Is that correct? Or are you using Jira Server (self-hosted)?
I ask this question because the functions/customizations you found using Javascript are applicable to Jira Server, however, they can not be implemented in Jira Cloud because Javascript and HTML create an XSS vulnerability and, for that reason, they are not allowed in Jira Cloud. You can find more details in the following documentation:
Functional differences in Jira Cloud products
That being said, the best way to set a default text for the summary field based in the request type selected in Jira Cloud would be by using Jira Automation. These would be the steps:
Let us know if you have any questions.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Petter Gonçalves I've tried your instructions for Jira Cloud and does doesn't seem to resolve what I was hoping to accomplish. When I go to create a new issue it still has a blank required field in the standard Create issue dialogue and clicking create without anything input into the summary results in the "You must specify a summary of the issue." so the Automation never runs.
My hope was to default this create issue Summary to "[Auto]" and if the user overrides it will use the new name otherwise my automation post create would replace the name with fields provided at the time of creation by the user to format a default summary. Ideally, for this type of issue I'm designing, 99% of the time I don't want the user to have to think about entering anything in the to required Summary field.
The automation 'When: Issue Created' seems to only trigger post creation dialogue.
It is also unclear as your steps refer to "Project automation (Not automation)", I only see Automation under the Project settings. I do not see anything that might indicate a difference between Project Automation and Automation.
Am I missing something or is there another way to achieve my goal?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.