Reqular expression on ip adress

Issue #280 resolved
FatimaM created an issue

How can I validate on ip adress

the format is XXX.XXX.XXX.XX or XXX

X-is numeric value

the last digits could be 2 or 3 numbers

Comments (19)

  1. Fidel Castro Armario repo owner

    Hi Fatima,

    You can do it using "Validation based on regular expression" with the following configuration:

    Captura de pantalla 2016-03-31 a las 15.11.42.png

    The regular expression used is:

    \d{3}\.\d{3}\.\d{3}\.\d{2,3}
    

    If you want a standard IP validation you can use the following regular expression:

    \d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}
    
  2. FatimaM reporter

    May be you could know how can I get ip adress of reporter while issue created and store it in custom field

  3. Fidel Castro Armario repo owner

    Sorry Fatima, I don't know how to obtain the IP address of a JIRA user, and don't think it's possible unless the user is currently logged in JIRA, something that it probably not the case when you are trying to obtain the IP of the user.

  4. FatimaM reporter

    Thanks for given advice.Could we indicate in condition that apply this validation to issue created through Customer Portal(Service desk)?Because we create issues by sending them to mail and this validation also applied here.And tickets through mail does not created.

  5. Fidel Castro Armario repo owner

    Have you tried the validation in a transition executed manually? Have it worked?

  6. FatimaM reporter

    yes,through Portal works,it does not write the message of Validator,but says something technical staff

  7. Fidel Castro Armario repo owner

    Then its not working correctly. It should show custom the message.

    Can you please attach a screenshot, or copy and paste the message you are getting?

  8. FatimaM reporter

    Error We were unable to submit your request. Please refresh the page and try again. Note that this will clear your request details.

    If you have already tried again, contact your JIRA Administrator.

  9. Fidel Castro Armario repo owner

    I think that the problem is that the field where you store the IP address is not set when you create the issues by email.

    Try replacing your current regular expression with this one:

    (^$)|(\d{3}\.\d{3}\.\d{3}\.\d{2,3})
    
  10. FatimaM reporter

    With mail it ok.We could not indicate ip adress in mail.But through portal it shows this message again.Could it be possible to show Validator message

  11. Fidel Castro Armario repo owner

    Can you please send me a screenshot of the technical staff you see when you create an issue through the Portal?

  12. Fidel Castro Armario repo owner

    I will investigate whether there is a solution, but I'm afraid that it's a limitation of JSD Portal.

  13. Fidel Castro Armario repo owner

    Hi Fatima,

    The message shown to portal users is always the same, and does not include custom message provided by validators, because of JIRA limitation.

    I have created JSD-3647 issue at JIRA Support, since it should be fixed by Atlassian. You can add yourself as watcher to that issue.

  14. Log in to comment