Linked Issues Validator Problem
Hello -
First of all - I want to thank you for inviting me to create a topic after responding to my problem via the Atlassian Community thread. To give a bit of context, here is what I'm dealing with -
I have a project with two Issue Types, on two separate workflows. It's an HR on-boarding project. The two Issue Types are Potential Candidate and Open Position. The idea is that I have multiple Potential Candidates linked to one Open Position. When I create a Potential Candidate it automatically gets linked to the Open Position that I choose via a Query Custom Field that I created. That works well.
Let's say that I have five Potential Candidates linked to one Open Position. Eventually one Potential Candidate reaches the end of its workflow (to On Contract status), which automatically transitions Open Position from Vacant to Done (on its workflow). This automatic transition happens through a rule I created through JIRA Automation. That works well.
Now I have four Potential Candidates remaining on the workflow. I want to be automatically prompted and required to change the remaining four Potential Candidates' Query Custom Fields in order to assign them to new Open Positions.
I am trying to do this by the Validator titled "Validation on Linked Issue" for my Open Position workflow (see screen shot for my configuration). The Validator occurs when Open Position transitions from Vacant to Done.
I also created the Post Function titled, "Write field on linked issues or subtask" (see screen shot) for the Open Position transition from Vacant to Done. The idea for this post function is to be prompted to change my Query Custom Field.
Now when I transition a Potential Candidate to On Contract status Open Position (that it's linked to) Open Position does transition from Vacant to Done, however, at no point am I prompted to change the remaining Potential Candidates' Query Custom Fields.
The version of JIRA that I am using is 7.3.6. The version of JIRA Workflow Toolbox is 2.2.38.
I know I've written a mouthful, but any help/insight would be so much appreciated. I have done lots of research and have been stuck on this problem for about a week now. Thanks in advance.
-Michael Gayheart
Comments (23)
-
reporter -
reporter Hi -
Please disregard the Post Function that I configured. I just realized that it was the wrong one. Attached is the correct Post Function and configuration for "Write field on linked issues or subtasks."
I am still having the same problems with this Post Function configured -
My linked Open Position automatically transitions to from Vacant to Done (when a Potential Candidate is On Contract), but at no point am I prompted to change the Query Custom Field of the remaining Potential Candidates.
-
repo owner Hi @magayhe,
I think that your use case can be easily implemented, but I have a question before giving you the exact configuration:
Are you using conventional JIRA issue links or some other kind of linkage? I don't know of "Query Custom Field". Which type of field are those?
I screenshot of a real Open Position and Potential Candidate would be helpful.
-
reporter Hi Fidel -
Thanks for the response. The Issue Link post function is all of the sudden not working. I don't understand why. Earlier today I when creating a Potential Candidate, that Issue would automatically link with whatever Issue I selected from the Vacancy Field (that's the Query Custom Field I had already created).
The Query Custom Field I created is from an add on called "Query Custom Field," which I got on the add on page.
The first screen shot is Issue Type Open Position. When I create this Issue it populates as an option for the Vacancy (Query Custom Field in Potential Candidate screen). You can see that on the second screenshot, showing the create Potential Candidate.
Again, thanks for your attention here.
-
reporter Second Screen -
-
repo owner I would like to see the issues once created, in order to see the actual issue link type being used to link both issue types.
How is called the issue link type you are using to link both issue types? I want to see the name of the issue link type in both directions: from Open Position to Potential Candidate, and from Potential Candidate to Open Position.
-
reporter So the only Issue Link that is supposed to occur is Potential candidate linking to Open Position. This is what it looks like when I create an issue now (first screenshot) -
-
reporter The second screen shot shows what it looks like when the two are linked, which earlier today was working. In this shot I manually linked the two issues by clicking More>Link -
-
reporter I just figured out the problem about the Issues being linked. With the post function "Create Issue Link" I needed to put that under all of my other post functions in order to link Open Position when I create Potential Candidate.
The screenshot shows the configuration of how I can automatically link Potential Candidate to Open Position when I create Potential Candidate.
I am now back to my original problem, trying to figure out how to automatically be prompted to update Potential Candidate fields when one Potential Candidate fills an Open Position.
I apologize if I am making this more confusing. Please let me know if I can explain some details better. And again, thanks for the help.
-
repo owner Hi @magayhe,
Inserting a validation in transition from Vacant -> Done in Open Position workflow will not show you a failure message when the transition is executed automatically by JIRA Automation. It will only show the message when executed manually.
I propose you the following solution:
1) Remove the rule in JIRA Automation for transitioning Open Position from Vacant to Done.
2) Add "Write field on linked issues or subtasks" post-function into transition to On Contract status in Potential Candidate workflow with the following configuration:
In relation to the rest of parameters of the post-function: select Open Position as issue type, and Vacant as status.
3) Add "Copy a parsed text to a field" post-function into transition to On Contract status in Potential Candidate workflow with the following configuration:
Text to be parsed is...:
toString(filterByIssueType(linkedIssues("relates to", filterByIssueType(linkedIssues("relates to"), "Open Position")), "Potential Candidate") EXCEPT issueKeysToIssueList(%{00015}))
where %{00015} is field code for Issue key.
4) Add "Break issue link" post-function into transition to On Contract status in Potential Candidate workflow with the following configuration:
Leave the rest of parameters unchecked or empty. Once configured the post-function should look like this:
Important: Insert this post-function after the one described in step 3).
5) Edit your current "Validation on linked issues" in transition from Vacant -> Done in Open Position workflow and set parameter "Skip validation when:" as shown in the screenshot:
-
reporter Hi Fidel -
The info you sent me looks great. I am currently attempting to make all of the above configurations. Quick question - for the "Copy a Parsed Text to a Field" post function. In the "Text to be Parsed" script that you sent me, which Issue Key should I insert for the %{00015}? Should I find the Issue Key for Open Position? Or Potential Candidate.
I am meticulously following your steps. This level of configuration is more advanced than I am used to. I really appreciate your detailed instructions.
-
repo owner You should simply write
%{00015}
.Take care of write correctly the names of the statuses, issue link types and issue types.
-
reporter Hey Fidel -
So I have implemented all of your configurations. This is what it looks like. Note - regarding my previous question, for the Issue Key I inserted the field code for Vacancy (the Query Custom Field). I think that's what I was supposed to enter.
At this point I think I am very close in solving my problem. When one Potential Candidate finishes the workflow the Open Position automatically updates, with the JIRA Automation rule turned off. The other Potential Candidates, however, remain in the workflow and seem to still be linked to the original Open Position.
I will post the screen shots. Here is Potential Candidate - Post Functions:
-
reporter Open Position Validator -
-
reporter Candidate 1 - On Contract - Open Position - Done
-
reporter The current problem I am facing is when I edit the Vacancy field of Candidate 2, after Candidate 1 is On Contract. When I complete the Candidate 2 workflow the Vacancy still remains Status:Vacant
What you mentioned before still applies - the Status is Vacant, and when I try to manually update the Open Position to Done, I get an error message stating "Workflow Error. Illegal Workflow Operation."
Based on the configurations I have made, Candidate 1 and (the first) Open Position work perfectly. It seems to me that when I try to reassign Candidate 2 to a new Vacancy (other Open Position I have already created), a proper link between the two Issues does not occur.
-
repo owner Hi @magayhe,
Do the following 2 changes in your current configuration:
-
Write literally
%{00015}
in the expression. You don't have to replace it with Vacancy or any other thing. That field code is automatically replaced in runtime with the issue key of current issue, i.e., the candidate who is transitioning to "On Contract" status. -
Move exchange execution orders of post-functions 1 and 2. Field Ephemeral string 1 should be set before executing "Break issue link".
-
-
reporter Thanks for your timely responses, and for being patient with me. Here is what my Potential Candidate Post Function now looks like -
-
reporter When Candidate 1 is On Contract, Open Position transitions to Done. This is perfect -
-
reporter Now I switch to Candidate 2. I manually changed its Vacancy field to a new Open Position (that I have already created). I transitioned Candidate 2 to On Contract, and the Vacancy status is still Status:Vacant
-
repo owner Hi @magayhe,
Can we have a screen-share through Skype? I would like to see the problem in direct. My Skype user is fidel100r.
-
reporter Sure thing. My name on skype is drewgayheart. I will find you.
-
reporter - changed status to resolved
Problem solved!
- Log in to comment
Here is the Post Function configuration - ![Write Field on Linked Issues - Post Function.png]
(https://bitbucket.org/repo/Lob6o9/images/672774276-Write%20Field%20on%20Linked%20Issues%20-%20Post%20Function.png)