Hi,
i have a question regarding issue ID in JIRA. I have a custom field with the name "Issue ID" and i want to set this value automatically after the issue is created. With this small script i get the issue ID but how can i set/copy this value to the "Issue ID" Custom field when the issue is created? I want to do it automatically with a Post Function.
import com.atlassian.jira.issue.Issue; Issue issue = issue def id=issue.getId()
Thanks
BR
As we are using "Prototype" Issue type in our company we need Issue ID (Custom Field). The procedure is following:
I create a new JIRA issue and the custom field is only on "Edit" and "View" screen. When the issue is created the "Issue ID" Field contains the ID which i can grabb with the small script above for example 33904. How can i do it with a groovy script? I want to do it as a Post Function after the issue is created.
Thanks
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Haris, even though your question is about setting the value for the custom field, it looks like you do not need to have another field to store the id. Can you eloborate why you are doing this?
And for setting the value, the guide for Script Runner - https://scriptrunner.adaptavist.com/latest/jira/recipes/workflow/postfunctions/set-issue-attributes.html
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I suspect Haris is looking for an immutable issue id - one that does not change when an issue is moved.
The database ID is ideal for that, so exposing it is probably better than generating another one. But it's not actually that useful, as JIRA's UI does not use it in any way, you can't link to it or anything.
The issue key, while not immutable, is still far more useful for users.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
As we are using "Prototype" Issue type in our company we need Issue ID (Custom Field). The procedure is following:
I create a new JIRA issue and the custom field is only on "Edit" and "View" screen. When the issue is created the "Issue ID" Field contains the ID which i can grabb with the small script above for example 33904. How can i do it with a groovy script? I want to do it as a Post Function after the issue is created.
Thanks
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.