Hi there,
I need to set a specific value on a custom field within some linked issues but not all of them.
I'm using the 'Set field value of related issues (JMWE app)' Post Function and am using the 'Issues Returned by the following Groovy script' option to find the specific related issues that I require updated.
From the research I've carried out to date the following syntax returns a list of all of the related issues
issue.getLinkedIssues()
And these are the results:
ArrayList
[Test-250, Test-249]
So this gives me all the related links which is great but I need to break that down further and only have the 'Result Value = Test-249' and not just list all of the related issues.
Is this doable? Does anyone have the correct syntax to use in this scenario?
Any help appreciated...
Thanks
Hi,
That's an old subject but I have a very similar question to this, and cannot find the answer.
I would like to use the same post function, but to retrieve issues with a given set of link types. In the above answer, I tried to replace "issuetype" by variants of "issuelinktype", without success. Does anyone know how to do this ?
Thanks
why would you even need to use a Groovy script for that? You can simply use one Set field value of related issues (JMWE app) post-function per link type.
But if you really want to use a single post-function, and use the 'Issues Returned by the following Groovy script' option, the script could be:
issue.getLinkedIssues("link type direction name 1") + issue.getLinkedIssues("link type direction name 2") + issue.getLinkedIssues("link type direction name 3")
Note that you need to use link direction name (e.g. "blocks" or "is blocked by") and not the link type name ("Blocks")
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks @David Fischer , I didn't think I could add the issues simply with the operator "+". As for the reason to do this, Here is a screenshot of the actual post-function implemented with another plug-in that you will surely recognize, and which I want to rewrite with JMWE.
Several link types (but not all), several fields updated, all in a single post-function. The JMWE "Set field value" allows to set value for only one field. If I had to rewrite this specifying only one link type, I would have to add (number of link types)x(number of fields to be updated) post-functions !
JMWE has multiple benefits compared to the other plug-in, but the ability to set value for multiple fields at once is clearly missing.
Regards,
David
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi David,
Thanks for the clarification.
You can use the + operator between lists and arrays, which is what getLinkedIssues returns.
As for a Set Issue Fields post function, it already exists in JMWE for Jira Cloud and will be coming to Jira server soon.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks. Actually we ARE migrating to Cloud, our Go Live is in 18 days. In our Server instance, we used JWT until now, but I wanted to change so we purchased a license for JMWE Cloud. Instead of rewriting all post-functions with JMWE after the migration, I reckoned that I could do the rewriting in our Server instance, before the migration (thus using a trial license of JMWE Server), and then use the JMWE migration path.
When the migration is complete, I will take the time to "factorize" my multiple set single field value post-functions into one.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Be careful though, because of major architecture differences between Jira Server and Jira Cloud, JMWE is also fairly different and, in particular, all scripts will need to be rewritten during the migration. Check https://appfire.atlassian.net/l/cp/zx4pjeCU for details.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
That is bad news indeed. I didn't clearly understand that Groovy was dismissed, and 80% at least of my post-functions have Groovy expressions... I guess it's better to have them migrated and having to change the expressions afterwards, than having to recreate all post-functions, since I only have a week-end to do that. Fortunately lots of them have simple expressions like constants or things like issue.get("assignee").
Do you know any converter from Groovy expressions to Nunjucks or Jira expressions ? Or tips to do it more easily than having to learn these languages from scratch ?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Unfortunately there is no converter, and the languages are very different. But Nunjucks is actually fairly simple, and JMWE does help you identify what needs to be updated once on Cloud
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
What is your criteria for filtering the linked issues? How do you decide which linked issues should be updated?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi David,
The linked Issues are all using the same Link Type so I'm thinking that the best way of filtering the issues so that I just update the one I need to is via the 'Issue Type' name...
Is that feasible?
Rgds,
Vivienne
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Vivienne,
sure, you could do something like:
issue.getLinkedIssues()?.findAll{it.get("issuetype")?.name in ["Bug","Task"]}
to return all linked issues of type Bug or Task.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi David,
That worked...
Thank you so much for the help on this... appreciate it.
Rgds,
Vivienne
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.