Hey all!
we want to create a scripted custom field via script runner.
This should create a QR image with information from a text custom field.
I use this code here:
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.Issue
import com.atlassian.jira.issue.MutableIssue
import com.atlassian.jira.issue.fields.CustomField
import net.glxn.qrgen.QRCode
import net.glxn.qrgen.image.ImageType
def issue = issue as MutableIssue
def customFieldManager = ComponentAccessor.getCustomFieldManager()
def qrCodeField = customFieldManager.getCustomFieldObjectByName("QR Code")
def fkLeitzahlField = customFieldManager.getCustomFieldObjectByName("FKLeitzahl")
def fkLeitzahl = issue.getCustomFieldValue(fkLeitzahlField)
def qrCode = QRCode.from(fkLeitzahl).to(ImageType.PNG)
def qrCodeImage = qrCode.stream()
issue.setCustomFieldValue(qrCodeField, qrCodeImage)
issue.save()
and put the jar file "qrgen-1.3" in atlassian-jira/WEB-INF/lib/ and restarted our two nodes.
Unfortunately, when testing, I get the error that it cannot find this jar file "java.lang.NoClassDefFoundError: net/glxn/qrgen/QRCode".
Br Harald
If you want to add an extern jar file to your Jira instance, you shouldn't add it to the WEB-INF/lib folder.
Instead, you should add it to the <JIRA_HOME>/lib/ folder, for example, /opt/atlassian/jira/lib/ and you will need to restart your Jira instance.
I hope this helps to solve your question. :-)
Thank you and Kind regards,
Ram
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.