I had to create a custom Footer with only "Impresum" and display it everywhere in Jira. Since I didn't find that much help, I wanted to share my work with the community.
Here the ScriptrRunner Documentation Web Resource.
1. First you need to edit JVM_REQUIRED_ARGS in the file setenv.sh (or .bat) and add following value
'-Dplugin.resource.directories=D:/Jira_home/scripts -Dother.properties'
// ExampleJVM_REQUIRED_ARGS='-Dlog4j2.contextSelector=org.apache.logging.log4j.core.selector.BasicContextSelector -Dlog4j2.disableJmx=true -Dlog4j2.garbagefree.threadContextMap=true -Dlog4j2.isWebapp=false -Djava.awt.headless=true -Datlassian.standalone=JIRA -Dorg.apache.jasper.runtime.BodyContentImpl.LIMIT_BUFFER=true -Dmail.mime.decodeparameters=true -Dorg.dom4j.factory=com.atlassian.core.xml.InterningDocumentFactory -Dplugin.resource.directories=/var/atlassian/application-data/jira/scripts -Dother.properties...'
2. Create a new directory "custom-footer" in your scripts directory (for me /var/atlassian/application-data/jira/scripts)
3. Create two new files in the directory:
custom-footer.js
AJS.toInit(function() {
// Add new div-Element
const customFooter = AJS.$("<div>")
.attr("id", "custom-footer")
.addClass("custom-footer");
//Create a-Element and set properties
const impressumLink = AJS.$("<a>")
.attr("href", "https://my.company/info/impressum/")
.attr("target", "_blank")
.attr("rel", "nofollow")
.text("Impressum");
// Add the a-Element to the div-Element
customFooter.append(impressumLink);
// Find the footer-Element
const footerElement = AJS.$("footer");
// Check, if the footer-Element was founded
if (footerElement.length) {
// Add div-Element after footer-Element
footerElement.after(customFooter);
} else {
console.error("Footer-Element couldn't be founded");
}
}
});
custom-footer.css
.custom-footer {
font-size: 12px;
font-weight: bold;
line-height: 1.66666667;
text-transform: uppercase;
margin-top: 40px;
cursor: pointer;
text-align: center;
margin-bottom: 70px
}
.custom-footer a {
color: #707070 !important;
text-decoration: underline;
}
.custom-footer a:hover {
color: #0052cc !important;
}
.footer-body{
display: none !important;
}
4. Restart Jira
5. Create new web resource in ScriptRunner fragments
Note: custom-footer
Context(s): atl.admin atl.global
Key: custom-footer
Resources:
test-resources/custom-footer.js
test-resources/custom-footer.css
You will need to hard refresh your browser to see the changes, or you can set -Datlassian.dev.mode=true (only in a development instance is recommended).
Please feel free to give me feedback if you have any suggestions :)