Hi everyone,
I am still very new to Jira and I am not sure how to go about this task. (Listener? Behavior? Something else?)
I have a project lead who would like to automatically generate a comment when closing a BUG issue with a set of questions of what was done for the user to answer before saving.
I found the code below (For a Behavior I believe) but in the statement on line 8, I do not have the issueID.
I did further reading and I believe I need to use ether the issueContext or underlyingIssue objects but am unsure of how to get a hook into ether of them.
Am not sure if I am even on the right track.
Is a behavior the right home for this?
How do i access the issueContext and underlyingIssue objects?
Thanks!
Hi @CJ_Marchand ,
I think it is possible to solve it with a behaviour. See screenshot as an example of a behavior that I succeeded with (sorry for the Dutch language in the example).
Regards, Marco Brundel
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I would actually use a Postfunction to add a comment. I would also do this on a step in the workflow before you close the ticket. To me if a ticket is closed it's closed. It won't get the attention that is needed because I am focusing on tickets that are not resolved and still "in progress".
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for the response Tim.
Looking into Postfunctions now.
When adding the Postfunction “Add a comment to this issue” to the transition to “DONE”, will it allow the user to edit the comment before the issue is closed? Or could they still edit the comment after it is close?
They need to respond to some of the questions in the comment template about how they resolved the bug.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
It would not allow them to enter the comment during transition, but after they could.
Thinking about your requirements, I would tackle this differently. I would create a text multiline customfield. Then using behaviours, you could add default text with what you need. Have a little template. Then when you transition to do done have a screen with that field come up so the user can answer the questions.
def descField = getFieldById("customfield_xxxxx")
def descFieldObj = customFieldManager.getCustomFieldObject("customfield_xxxxx")
def defaultValue = """
Text goes here
""".replaceAll(/ /, '')
if (!underlyingIssue?.getCustomFieldValue(descFieldObj)) {
descField.setFormValue(defaultValue)
}
@Marco Brundellooks to have the same idea, but actually is working with the comments. The reason I say use a custom field is then one of the benefit is you can use it in searches and easily export if needed.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The customer requested a comment but I do not see why they would reject a CF. Especially with the added benefits you state.
The field could be hidden till needed.
I think I will contact the Project Lead and see if he can live with a CF rather then a comment.
Thanks for the help from both of you.
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.