Team,
We have a requirement like..while creating or updating issue users are providing the values and that values should not be duplicated.
For example: let say there is a label type field and already that field has TEST value for an issue and while creating/updating new issue a user should not add TEST value.
Any suggestions will be appreciated.
Note: It's not like only for Label type field if you have any idea or suggestion to achieve this then also welcome. The main purpose is ..user should be able to add multiple values to that field and the values should not be duplicate.
Hi Yogesh,
Did you find any solution for this as we are also having the same requirement where we want to restrict the user from creating the ticket with the existing value in an alphanumeric field?
Thanks,
Eshwar.
Yes, using the script we did it.
First, you need to fetch the values of the label field and see if the user is entering the same values which are already contained. if so, then set the error saying XXX values already exist or contain with XXX issue key. if not, then allow the user to add it.
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.
Hi Yogesh,
Other than restricting who can create labels using scriptrunner behavior plugin or using the component field, there is no way to prevent people from creating other labels that do not match the one you already have.
I will lean more towards the component field because it is clear that the project admin is the only person who can add component.
Cheers
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for your response.
What im thinking is ..we can do it using a script validator where we can fetch all the values of the field and then check whether the new field value is equal to existing value or not.
if so, then we should throw an error called this value already exist.
What do you think?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
This could be possible but then resource intensive as you will either need to do this from a cron service, or by event listener which means issue update event that I cannot recommend.
This also does not scale because if a label has already been used, how does the script determine which to delete and depending on how many issues you have and how many labels per issue it could mean an issue update takes multiple minutes to be completed.
Hence, though this is possible, I cannot recommend it. Instead as suggested earlier constrain available Labels to those someone created and other users can then select from this when they type.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Ismael Jimoh , Yeah I understood but here the problem is we are using a multiline text field where users need to enter the alphanumeric character which is generated in SAP while creating/updating issue manually, so sometimes users are adding same alphanumeric character which is already added by someone on issue.
So my team manager wants that the user should not add the same value.
How we can restrict this.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Are you using the standard label field or a text field as your last comment has me confused.
Yeah I understood but here the problem is we are using a multiline text field
Do clarify this.
Cheers.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Actually, while implementation we used multiline text field but while adding data to this text field users are entering semicolon, comma, colon (: , ;) for value separation and also adding duplicate values to avoid the value separator I thought like we should go for label type custom field so that user don't need to add separator here...so with this label type cust field now i want to avoid value duplication.
Hole it clear.
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.
Hi @Yogesh Mude
Do the following:
Your final solution should look like:
When user attempt to add values to the label, it will bring up the edit screen and the field will be locked to them still.
Cheers.
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.