1). How to read the custom field value ?
2). How to make issue type ?
3). How to link the issue type ?
Please help me with groovy script for above requirement.
Hi Deller,
1) Here is a code to get custom field value:
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.Issue
import com.atlassian.jira.issue.fields.CustomField
//Define custom field variable
CustomField customField = ComponentAccessor.getCustomFieldManager().getCustomFieldObjectByName("field name")
//Definr issue variable. There is a build-in variable into script postfucntions, conditions and validators.
//Since this line should be commented
Issue issue = ComponentAccessor.getIssueManager().getIssueObject("issue key")
//get custom field value
issue.getCustomFieldValue(customField)
//or
customField.getValue(issue)
2) What do you mean "make issue type" - does it mean to change issue type?
3) There is no link "issue type". The only option - change issue type.
Best regards,
Vasiliy
Thanks Vasily for your response !!
2) What do you mean "make issue type" - does it mean to change issue type?
I want to create my own issue type, based on the custom field condition.
Suppose, if the custom field value is no then do nothing. If it's yes create the new issue type with name "Bug".
This is what i want.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You see, issue type is one of basic values of an issue. Because with it issues assotianted with workflow, screent scheme, field configuration scheme. So, change issue type is very difficalt operation.
Do you want to create new issue from current or you want to change issue type of current one?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks Vasiliy !!
So, If i want to create my own issue type, what changes required in JIRA and how it will impact the overall process ?
If you can help me with groovy script, how can i read the value from available issue type and change issue type of current one ?
Regards,
Dileep.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Usually need to change issue type in script means that Jira is used into incorrect way.
Here is documentation for issue types: https://confluence.atlassian.com/adminjiracloud/adding-editing-and-deleting-an-issue-type-844500747.html
You need no code for this.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.