HI Community once again today,
because of the needs of one project, we want the value in the Key field to never be repeated.
Just to check the value during the entry and, if it already exists, to give an error in the entry. Is that somehow possible?
Best regards
Jurica Petricevic
you can use a Scripted (Groovy) Validator with one line of code that uses the jqlSearch global function. The exact code depends on the custom field type of the Key field. The biggest issue is if the field is a Text field, because by default Jira won't allow searching for an exact value in text fields (the "search template" associated with text fields only supports fuzzy searching using the ~ operator). Unless you also have JMCF, which offers an "Exact text searcher" search template you can use with standard Text fields.
the problem is as following: The entire project mengement will be moved to Jira / Structure.
One field called Key, which is mandatory, is where the project manager defines the project key. It is not a Jira field nor will it ever be. This is a field that will always be entered manually but the value must never be repeated.
I have ScritpRunner, JMWE and Automation for Jira at my disposal.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Jurica Petricevic they're must be a misunderstanding - any data you can input and associate to a Jira issue must be in a Jira custom field. So I assume the Key field will be a custom field. Right?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
yes, sure.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Then, as I mentioned, you can use a Scripted (Groovy) Validator with this code:
jqlSearch("ProjectKey ~ '${issue.get("ProjectKey")}'", 1).size() == 0
Where ProjectKey is the name of the field (of type single-line text) in which the user enters the key. You shouldn't call it "Key" because that field name is already used by Jira.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@David Fischer Perfect.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The issue key (which is what we assume when people say "key" in Jira-speak) will always be unique.
If you mean you are talking about another key field of some sort, then no, you can't enforce this without doing a bit of coding that validates people aren't entering more of the same.
I'd question the need for this though. What is your "key" field capturing?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
the problem is as following: The entire project mengement will be moved to Jira / Structure.
One field called Key, which is mandatory, is where the project manager defines the project key. It is not a Jira field nor will it ever be. This is a field that will always be entered manually but the value must never be repeated.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I don't understand that.
If it's not going to be a Jira field, then there's no need to try to enforce uniqueness in Jira
Could you explain what this field is actually supposed to be capturing?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
PPRO - for 3Projects-Project
RREQ - for 3Request-Project
USTA - for 3Stay-Project
etc.
bold should always be unique and it is written by the project manager.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Ok, but what actually is it the data for? Why are you putting it in? And where is it going into Jira if it's not a Jira field?
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.