Need help with restricting linking post-function

Issue #802 resolved
Rose Sahagun created an issue

We installed in production and are using this plugin in one of our project workflows to link tickets upon creation based on an identical custom field value, in this case Loan Number.

However, there are two issues - 1. The tickets getting linked to the current issue are from all other projects in the instance, we would like to restrict to only the current project, I tried setting that jql up but I think I have done so incorrectly?

  1. The current ticket with customer request type of "general questions" should not be linked - how can I exclude the request type from the linking post function?

Again, the restriction on project and on request type are on current issue. I am attaching the entire linkin post-function config screen with the JQL/condition I set up.

Thanks! Rose

Comments (18)

  1. Fidel Castro Armario repo owner

    Hi @rsahagun,

    Use post-function "Create issue link" with the following configuration:

    Captura de pantalla 2017-09-19 a las 22.20.48.png Captura de pantalla 2017-09-19 a las 22.21.23.png Captura de pantalla 2017-09-19 a las 22.21.34.png

    JQL Query for destination end:

    "Loan Number" ~ %{10179} AND issue != %{00015} AND project = %{00018}
    

    where %{00015} is field code for Issue key and %{00018} for Project key.

    Field codes for custom fields depends on each particular JIRA instance. Field code %{10179} corresponds to custom field Loan Number in your JIRA instance.

    Conditional execution contains the following boolean expression:

    %{00178} != "General Question (PDP)"
    

    where %{00178} is field code for Customer Request Type Name.

  2. Rose Sahagun reporter

    Hi Fidel,

    Thank you very much for your input. I updated the post-function and will be making the changes in our production instance later tonight. I will confirm if this resolved our issue.

    Thanks again, Rose

  3. Rose Sahagun reporter

    Hi Fidel - I wend ahead and configured the post-function as indicated a week ago and today, however I get the following error when trying to create a ticket that is not the "general question" request type we are trying to exclude from linking.

    The ticket does get created but the customer view shows the attached error. workflow toolbox plugin - error when excluding request type from linking pfunction.JPG

    Thanks in advance for your help! Rose

  4. Fidel Castro Armario repo owner

    Hi @rsahagun,

    Which type is field Loan Number?

    Can you, please, give some examples od values of field Loan Number?

  5. Rose Sahagun reporter

    Hi Fidel,

    The loan number field was built as a text field, however values are usually numeric.

    What we need to have happen is that should a request not have a loan number to link tickets by, which is the case for general question requests, then exclude these tickets from linking.

    What is happening now is that general request tickets without a loan number do get created but the error I shared is displayed rather than the created ticket screen.

    Thank you, Rose

  6. Fidel Castro Armario repo owner

    Hi @rsahagun,

    Sorry, but I don't understand what you mean by "What we need to have happen is that should a request not have a loan number to link tickets by, which is the case for general question requests, then exclude these tickets from linking.". Can you, please, explain it in other words?

    Anyway, please try the following JQL query:

    "Loan Number" ~ "%{10179}" AND issue != %{00015} AND project = %{00018}
    
  7. Rose Sahagun reporter

    Hi Fidel,

    The JQL you shared is the same you shared with me back on 9/19.....

    Let me try to explain again, we are linking tickets based on the "Loan Number" field, so tickets with the same loan number need to be linked.

    However, tickets that have the customer request type of "general question" need to be excluded from linking as they may not have any loan number value.

    We configured the post function as you shared back on 9/19 but there is an error that is generated when the "general question" ticket doesn't have a loan number value - the error says "invalid JQL query in post function" which I posted here on 10/01.

    Hope this helps!

  8. Fidel Castro Armario repo owner

    Hi @rsahagun,

    My last JQL query is not the same as the one I posted on 19th September, since it uses double quotes " around field code %{10179}.

    Please, try it and let me know whether it solves the problem.

  9. Rose Sahagun reporter

    Hi Fidel,

    I just encountered another issue with the create link post function. We have a rule in place that declines tickets without a valid loan number. It seems that this rule has stopped working due to the post function to link tickets by loan number.

    The way the system knows when a loan number value is invalid is by the value in an nfeed field called "concession approvals needed". If the value is "-1" then the system declines the ticket and goes from "New Concession Request" to "concession declined"

    When I try to manually decline the tickets I get a "invalid JQL query in post_function" error. I tried updating the rule to link "issues returned by JQL" only pull in tickets that:

    • do not have a "concession approval needed" != -1 or
    • have a value of "concession approval needed" = (1, 2, 3, 4,5)

    but even then I am not able to decline tickets with -1 approvals needed.

    Please see the attached screenshots of the rule, the current post function, and the error received.

    I am wondering how we can keep the ticket linking post function from preventing statuses from being set.

    Thanks in advance!! Rose

    workflowtoolbox_concession denied rule.png workflowtoolbox_concession linking postfunction.png workflowtoolbox_concession declined error from linking postfunction.png

  10. Fidel Castro Armario repo owner

    Hi @rsahagun,

    I see in your screenshots that you are still using the JQL query without double quotes around Loan Number field code, i.e., you are using %{10179} instead of "%{10179}".

    Please, add " around %{10179}, and let me know whether it solves the problem.

  11. Rose Sahagun reporter

    Hi Fidel,

    I made the update you recommended but I am still having the same issue when I try to decline a ticket that has an incorrect loan number value.

    Please advise, Rose

  12. Fidel Castro Armario repo owner

    Hi @rsahagun,

    Please, double check the type of field Loan Number. Is it a Number field, a Text field, or special field provided for a third-party add-on?

    Try the following JQL query:

    "Loan Number" = %{10179} AND issue != %{00015} AND project = %{00018}
    
  13. Rose Sahagun reporter

    As I had mentioned before the Loan Number field is a Text field. I am still getting the same error regardless on where the quotation marks go or do not go :(

  14. Rose Sahagun reporter

    we really need resolve for the 2 outstanding issues we have had, one has been open for almost a month now. If we can not resolve we will not be able to purchase this add on once our trial is up.

    Si quieres que te explique en espanol lo puedo hacer pero necesitamos ayuda con estos problemas. Necesito saber como podemos prevenir que la post-function que crea los links no prevenga mover el estado del ticket.

    Cuando alguien da un número de préstamo incorrecto e sistema debe de:

    • si es un ticket del tipo "general question" estos NO se deben de asociar con un link
    • si es un ticket que no tiene un número de préstamo válido (ocurre cuando "concession approvals required field = "-1") entonces estos tickets no se deben asociar con un link

    Espero tu respuesta, gracias, Rosa

  15. Fidel Castro Armario repo owner

    Hi @rsahagun,

    I need a screen-share in order to fully understand your workflow, and the problem you are experiencing.

    Can we have a screen-share through Skype on Monday 16th? I will be available from 9:00 UTC to 14:00 UTC, or from 15:30 UTC to 17:00 UTC. Can we arrange a meeting within those time intervals?

    I'm sure that your problem can be solved, but I don't manage to exactly understand your problem and your requirements.

  16. Log in to comment