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,560,606
Community Members
 
Community Events
185
Community Groups

Trigger listener event after workflow transition performed?

Hi Team,

We have been auto updating custom user picker based on multi select list field using custom listener, it works fine whenever field changed, but the real problem is I want to populate the user name when specific transition (open) performed.

Any event for specific transition action performed?

Thanks
T

1 answer

0 votes
Ram Kumar Aravindakshan _Adaptavist_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Jun 24, 2022

Hi @Teja

Since you want to trigger the update once the transition is performed, why not use the Post-Function instead?

Could you please share the current code you are using so I can review it and provide some feedback?

Thank you and Kind regards,

Ram

Hi @Ram Kumar Aravindakshan _Adaptavist_ 

For example: Release Note (User Picker field) need to populate user based on our Module list and another associated field named Documentation.

Here is my piece of code:

CustomFieldManager customFieldManager = ComponentAccessor.getCustomFieldManager()

//Module [Single select list field
CustomField moduleCustomField = customFieldManager.getCustomFieldObject('customfield_15300')

//Release Notes Author [single user picker field]
CustomField releaseNoteAuthorUserField = customFieldManager.getCustomFieldObject('customfield_14101')

Option moduleVal = null
def releaseAuthName = null

final Map<String, String> MODULE_RELEASE_NOTES_AUTHOR_MAP = new HashMap<>()

String releaseNotesaAutherValue = null

// Mapping for release notes Author
MODULE_RELEASE_NOTES_AUTHOR_MAP.put('Module', 'user')
MODULE_RELEASE_NOTES_AUTHOR_MAP.put('Module1', 'user1')
MODULE_RELEASE_NOTES_AUTHOR_MAP.put('Module2', 'user2')
MODULE_RELEASE_NOTES_AUTHOR_MAP.put('Module3', 'user3')


// Populate Release Notes Author update.
def releaseNoteValue = currentIssue.getCustomFieldValue(releaseNoteAuthorUserField)

//Check Release Note Author field is empty
if (releaseNoteValue == null){
moduleVal = (Option) immutableIssue.getCustomFieldValue(moduleCustomField)
String moduleName = moduleVal.getValue()

//Check for project and Issuetype
if((projectName.equals('XYZ') && issueTypeName.equals('Epic'))){
def documentationValue = issue.getCustomFieldValue(documentationType);

//Iterate documentation value in the list
if (documentationValue instanceof Collection) {
Collection<Option> coll = (Collection)documentationValue;
for (Object obj : coll) {
if (obj instanceof Option) {
Option opt = (Option) obj;
//Check if these values contains in Documentaion field
if ("User Guide".contains(opt.getValue() as String) || ("Customer Bulletin".contains(opt.getValue() as String))) {
releaseNotesaAutherValue = MODULE_RELEASE_NOTES_AUTHOR_MAP.get(moduleName)
releaseAuthName = userManager.getUserByName(releaseNotesaAutherValue)
log.info('Release Notes Author on Issue Update' + releaseAuthName)
}
}
}
}
//Update Release Note Author
releaseNoteAuthorUserField.updateValue(null, currentIssue, new ModifiedValue(currentIssue.getCustomFieldValue(releaseNoteAuthorUserField), releaseAuthName), changeHolder)
}
}

Thanks & Regards
Teja

@Ram Kumar Aravindakshan _Adaptavist_ 

I think when I perform the workflow transition the Generic Event was fired, is there any chance we use particular 'Generic Event' for that transition.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events