Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,551,726
Community Members
 
Community Events
184
Community Groups

Need message to assign the defect on view issue details screen

I am currently using a sub task (defect subtask) to manage defects.  Upon creating the create subtask link to create Sub task , a new a defect is created , I would like to assign the defect  to the developer using the Assign defect  button on the View issue detail screen.

I would like a  a warning message to be displayed  indicating the defect  needs to assigned on the  Issue view details page .

How Do I achieve this using script runner . Alternatively I would like to stop the open defect transition to be opened unless the defect  is assigned. I would like to display an error message if the developer clicks  on Open defect transition . 

I want to make sure that the defect  is not opened unless the defect  is assigned .Do not want it to be Un assigned .

 

Please suggest script runner solution for these issue .

2 answers

0 votes
Tim Perrault
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
Jan 14, 2022 • edited

Reread your question. I will need to think about the first part, but to stop the transition:

I think you will want to use a simple scripted validator on the transition in the workflow.



issue.assignee != null

Then you can put in the error message that you want.

ssv.png

Tim Perrault
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
Jan 14, 2022

For displaying a message you could create a custom script field and have that displayed on the view issue screen. The message would always be there, but I guess you could add a behaviour to hide it when someone has been assigned. Seems like overkill though.

 

I adapted something from this link https://scriptrunner.adaptavist.com/6.20.0/jira/recipes/scriptfields/informationMessage.html 

 

package com.onresolve.jira.groovy.test.scriptfields.scripts

import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.Issue
import groovy.xml.MarkupBuilder
import com.atlassian.jira.config.properties.APKeys
StringWriter writer = new StringWriter()
MarkupBuilder builder = new MarkupBuilder(writer)

builder.div(class: "aui-message aui-message-error shadowed") {
p(class: "title") {
strong("Please make sure this issue has been assigned")
}
}
return writer

csfield.png

Here is the screen shot of the view details screen

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events