I have used a simpler regex (because I know the project key) with mixed results. I tried adding \m and \M to your regex but it still matches those cases. test case TEXT1-123456789-MORETEXT, string.case OTHERTEXT-TEXT1-123456789-MORETEXT, string.However it also matches for other cases we do not want, such as It is an improvement over the one I have. At least this is true when the issue is still on the same Jira instance, which is to say if this is issue data migrated from a different Jira site then perhaps that redirect would not be expected to exist. When a project key is renamed, or issues in Jira are moved to a new project, I would expect that Jira would automatically attempt to leave a redirect for the location/issuekey of the new issue. But I'm also not sure why you are looking to change issue keys on the database level. I haven't used the postgresql regex lookup, so perhaps the syntax is a bit different there. Try that and let me know if you have any problems with that. In which case, a more precise regex could be (-*) Default value is 10, but this could be bigger or smaller in different environments. There is another possible value we need to lookup, that is back on the general settings page, it's called " Maximum project key size". I think this is optional in most cases, but just in case. However, you could try to refine this even further if need be. Next we look for the hyphen (-), and need to match at least one digit and the first digit will never be a leading zero in Jira. Ok, so the reason for this is that the first character has to be a letter (and capital letter at that), but then the project key can have either another letter or a number (but we need at least two characters for the project key), and then we can repeat the number of characters there. Using this tool I played with this for a bit and found what I think the correct expression to match a default issuekey. I really like the website of to help me figure out what my regex is going to match against using some realtime highlighting. We can use that as a base to start to figure this out. This value is actually in a regex format to begin with. This value will determine what are valid values for the project key (the part before the -1234 that we see in an issuekey such as ABC-1234). If you're a system admin, you can login to Jira and go to System > General configuration and then click the Advanced Settings button. This is because Jira server will allow a system admin to determine what is the correct patter for a Project Key to follow. However the answer here (at least for Jira Server and Data Center) could be different between systems. I understand you are looking to create a regex that will match Jira issue keys.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |