Updating Elements Connect fields with ScriptRunner in a single Issue Updated event

Alexandra Atanasiu
Contributor
October 31, 2024

Hi,

Upon creating an issue, I have a ScriptRunner script within a PostFunction which copies some field values from a bunch of Elements Connect fields to other Elements Connect fields.

I am using the setFieldValue method for each custom field, as described in 

https://doc.elements-apps.com/elements-connect/scriptrunner-use-elements-connect-api-in-a-script. This works as expected, however, I don't like the fact that each setFieldValue call triggers an Issue Updated event on the issue (each changed value appears as a separate event in the History tab of the issue). I don't like it due to certain performance concerns given that I also have an Automation Rule which can't be disabled yet, which is triggered on the Issue Updated event.

Any ideas on how I can do a "setFieldsValues" which only triggers once the Issue Updated event?

Thank you!

5 answers

1 accepted

Suggest an answer

Log in or Sign up to answer
0 votes
Answer accepted
Alexandra Atanasiu
Contributor
November 4, 2024

For the moment, the answer is (directly from the vendor): functionality not yet available. Will modify this answer once the feature is launched and I am informed by the Elements team.

1 vote
Bobby Bailey
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.
November 1, 2024

Hi @Alexandra Atanasiu , 

@Valerie Knapp is correct, it looks like you will have to raise this with the vendor. Looking further from your link you can find the Javadocs: 

https://elements-apps.github.io/elements-connect-javadoc/0.3.0/index.html

It doesn't look like there is any scope in those functions to include a parameter to disable notifications in the same way you can when using other methods to update Jira Issues.

https://community.developer.atlassian.com/t/issueservice-update-issue-without-sending-notification-mails/21611/5

As this is a function provided by the vendor to update fields, its safe to assume there is a reason they have their own update function and so wouldn't recommend circumventing it. 

Kind regards, 

Bobby

 

Alexandra Atanasiu
Contributor
November 4, 2024

Hi @Bobby Bailey 

Thank you for checking. In the meantime, I also reached the vendor (Elements) and it appears that there is no way to do it currently but there is an existing change request for it, in their private backlog.

They will update my ticket once the feature is available and hopefully I will also remember to update this post, for any future reference.

Have a great week,
Alexandra

Like # people like this
0 votes
Maelle Cartron - Elements
Atlassian Partner
November 4, 2024

Hi @Alexandra Atanasiu 

Thank you for reaching out. I'm Maëlle, Elements Connect PMM. Unfortunately this is not possible for the moment but this use case is in our backlog and we're actively considering it for future improvements ! 

Thank you for your understanding, and please feel free to reach out with any other questions!

Maëlle

Alexandra Atanasiu
Contributor
November 5, 2024

Hi @Maelle Cartron - Elements

Thank you for checking this, I already mentioned in the above replies that I contacted the vendor itself and received the same answer. I hope your colleagues will indeed update my support ticket once this feature is available so we can start using it.

Thanks!

0 votes
Valerie Knapp
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
November 1, 2024

Hi @Alexandra Atanasiu , thanks for your feedback. 

I agree that using a listener instead of a post function will use the same method in terms of listening for the issue creation event. If you want to ask if the elements app can consider more than one activity in the same event, I think you'll need to contact the vendor of Elements to ask this. 

Best wishes

Alexandra Atanasiu
Contributor
November 4, 2024

Hi @Valerie Knapp

Thanks for coming back to this. As I mentioned in the above reply, I contacted the vendor and currently this functionality is not available. Hopefully it will be, soon.

Have a great week,
Alexandra

Like Valerie Knapp likes this
0 votes
Valerie Knapp
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
October 31, 2024

Hi @Alexandra Atanasiu , thanks for your question. 

Could you use a listener for this? Have you had a look at the documentation here - https://docs.adaptavist.com/sr4jc/latest/features/script-listeners 

Please have a look and share your feedback if you think this could help / work for you. 

Best wishes

Alexandra Atanasiu
Contributor
November 1, 2024

Hi, @Valerie Knapp , thanks for checking this.

I am not sure I understand your suggestion. To use a listener instead of a PostFunction? The triggered event for which I run the ScriptRunner script to set the Elements Connect fields would be the same in a listener as well, "issue created".

This is not the cause of my issue but the fact that the script itself and the Elements Connect API is triggering individual issue updates for each setFieldValue call.

TAGS
AUG Leaders

Atlassian Community Events