You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.
View groupJoin the community to find out what other Atlassian users are discussing, debating and creating.
Hello,
I want to show/hide some fields depending on some conditions on a transition screen.
The transition screen has the name i.e. "A" the view/edit screen which is connected to the project of the transition is called "B - view/edit".
I tried the following code to check if I am on the transition screen at the moment (because the fields are also on the view/edit screen, where they always should be shown) (The code is located on one field of the transition and view/edit screen)
import com.atlassian.jira.issue.fields.screen.FieldScreenManager
import com.atlassian.jira.issue.fields.screen.FieldScreen
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.user.ApplicationUser
String currentUser = ComponentAccessor.getJiraAuthenticationContext().getLoggedInUser().getName()
if (getFieldScreen().name == "A")
{
}
With the log info I've checked the value of getFieldScreen().name, it is always "B - view/edit", even if I am at the transition screen :-(
Can anyone explain me how to chek why this check fails? Or what shoul I check to get the current screen? (transition screen)
I work with JIRA 7.1.2.
Thanks and kind regards
Katrin
Are you wanting to do this in a behaviour?
You can use behaviors to modify the visible/required fields on a screen. You can use a scripted transition to limit the behaviour to a particular workflow step, so that it's only applied on the relevant transition screen. You could add a script to a behaviour with something like:
if (getActionName() == "Transfer Ownership") {
def fieldToHide = getFieldByName("Some custom field I wish to hide")
def fieldToRequire = getFieldByName("Some custom field I wish to require")
fieldToHide.setHidden(true)
fieldToRequire.setRequired(true)
}
getActionName() contains the Workflow Status Name or the Transition name ? I tried both but doesn't seem to work. Can you please suggest.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Joshua,
Thank you for your answer! That works for me. :-) The only problem now is the flickering of the fields :-/ (field is shown - behaviour script runs - field is hidden) But this is something we can not solve here...
Thanks and regards
Katrin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi All,
I need a transition Screen when I move from Backlog (Status A) to Sprint backlog (Status B).
Is there a way to achieve this. Any suggestion provided will be really helpful.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Connect with like-minded Atlassian users at free events near you!
Find an eventConnect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.
Host an eventYou're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.