Dears,
i have 2 issue types Type 1 and Type 2
i need to block the user from creating type 2 using create button, as from the ticket created as Type 1 i have a transition to create a ticket with issue type = Type 2 and link it to Type 1 ticket.
I succeeded with blocking the users from creating issues of type1 but the transition of type 1 is not anymore working,
under the workflow of Type 1 i add create linked issue of type 2
Create Issue
Summary: Off Boarding %original_summary%
Description: This is an off boarding ticket created automatically via the worflow
Project: Original project
Issue type: Off Boarding (10602)
Priority: Parent's priority
Reporter: Current user
Assignee: Parent issue's assignee
Affected versions: None
Fixed versions: None
Components: Parent issue's components
Link: %original_key%, Link type: Relates, Link direction: From new issue to issue key
Copy original issue custom fields: Employee,Job Title
under the workflow of Type 2 i added this code under validator of create transition
if(issue.getLinkedIssues().size>0){ Issue issue = issue.getLinkedIssues()[0] if(issue.status.name == 'EMPLOYEE LEFT') return true else return false } else return false
thank you.
I think you have a chicken and egg problem. You cant "get linked issues" of the type2 issue, because it doesn't exist yet when you are trying to create it. So your validator will always return false.
There are very few items that can be accessed in the create transition. If the requirement is "only allow this issue to be created if it is linked to another issue" i'm not sure you can do that.
What you may be able to do (and I havent tested this, so i cant prove it will work or not) is have a field that is not visible on the create screen, but can get set from the workflow, and check validation on that field. That way its like a "secret" flag that can only be set from automation, and the user can't set it in the create screen.
I'm not sure it will work though, the field may need to be on the screen for it to get set in the create.
You might want to look at making the "type2" issue a subtask. You might have more options with parent vs linked issues.
I converted the type2 to sub task, then I put the condition on level of sub task creation that should be inherent from a parent of type1 and it works.
Thank you.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You can add a validator on the create transition that disallows one from creating an issue. I would put in the error message. "Do not create issue of Type 2, please use Type 1 for all new issues. If you need to create a Type 2 issue, please use these steps..."
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
That's what I do and I succeeded with blocking the users from creating issues of type 2 but my problem here that am not able to create the ticket from the transition of type1
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
There is a plugin called "Create on Transition" that makes that operation easy, Is that what you are using or are you trying to just use groovy?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
well am just using groovy under validators section of create transition of Type2
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.