Hello Community
Is there a way to copy one field value to another, where source field is text, and destination (to copy it to) is a drop down like Affected Services, or any other Insights field.
The idea is:
My form has a Dropdown of X values, which contain List of Services i want users to use on this form. My Insight Services list contains Y items, thats why I want users to restrict it to be able to select only some of the services.
Via Automation i want to get that value of Drop down list and "Assign it" to Affected Services form field which is and Insights object field.
@Alex van Vucht (GLiNTECH) thanks for your response.
However it does not appear to work, setting value {{issue.Service Objects.Name}} in the selected Affected Services, does nothing (affected services tries to run autocompletion, nothing is found, and the input box is cleaned up.
Instead, i have selected
{
"fields": {
"Affected services":[{"id": "{{issue.Service Objects.Service ID}}"}]
}
}
If you Service Objects field (which is a custom Insights object field type) accepts multiple values, you might as well wanna use Jira's loop-over-list template stanzas:
{
"fields": {
"Affected services":[{{#issue.Service Objects}}{"id":"{{Service ID}}"}{{^last}},{{/}} {{/}}]
}
}
if you don't want to use loop stanzas we can rather use this shorthand
{
"fields": {
"Affected services":{{issue.Service Objects.Service ID.asJsonObjectArray("id")}}
}
}
this documentation is taken from: https://support.atlassian.com/jira-software-cloud/docs/advanced-field-editing-json
Hello,
For the sake of others who may (by miracle) find this post, some helpful links and hints:
1) Please see and vote on this feature request: https://jira.atlassian.com/browse/JSDCLOUD-10340
Affected Services though it looks like an Insight Object custom field, and has an Insight schema backing it up, is in fact using Opsgenie API and Opsgenie's service id's for the items. Thankfully Opsgenie service id is stored in the Insight object as an attribute.
We had to use "loop stanzas" as the "shorthand" notation didn't work, kept successfully getting some numeric id value, instead of the Opsgenie Service ID attribute.
2) In our case the duplicate Insight Object custom field Services Affected is based on the same Insight schema, and is presented on the Issue Create scheme, together with dependent Insight Object custom fields.
Automation on create syncs the value to Affected Services.
3) Please note, the Affected Services field does behave differently in UI than the Insight field based on the same Insight schema, as it shows mode details from JSM/Opsgenie, so we preferred to keep that field on the edit and view screens, and hide the "parent" Insight field from these, only displaying it on create screen for the purposes of dependent drop-down functionality.
This does however then require addition setup in Automation to keep Affected Services and the "parent" Insight field in sync in the other direction, so if the affected service changes later in JSM ticket workflow, the dependent Insight field displays correct objects that correspond to the "sub-options". This automation rule is configured to run on Edit and Transition, and not be invoked by other rules.
Obviously, none of this is instantaneous, and is just one major kludge for something that should be so simple, and could have been avoided if the dependent Insight custom field could be dependent on Affected Services directly.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I'm hoping someone can help me here. I'm creating change requests via automation from Jira asset objects.
I need the change request to include any "Affect Services" listed on the asset object.
I use below in automation "more fields" to add Services to the change request -
{
"fields": {
"Affected services":[{{#object.Affected Services}}{"id":"{{Service ID}}"}{{^last}},{{/}} {{/}}]
}
}
This works great when the object has multiple "Affected Services" but if the object only has a single service I receive "Error while parsing additional fields. Not valid JSON."
??
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I've found a new solution that I have been able to adapt that solved my issue -
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Phillip Goffin , I also jumped into the same article, but my problem is not completely solved.
In my case, I need to have a branch with N objects. I need to add them one by one to the Affected Services field. For each one, I´m using the sintax bellow in the advanced edit field:
{
"update": {
"Affected services" :
[{"set":[
{{#lookupObjects}}
{"id":"{{Service ID}}"}
{{^last}}, {{/}}
{{/}}
]
}]
}
}
Otherwise, only the last item is added to the list. It seems that each command (each branch loop) overrides the previous content.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Renatão I'm not quite sure what you are trying to achieve and I am no way an expert in this but this is how I added multiple services to "Affected Services" field in an issue. Hope this helps.
Retrieve the custom field ID for Affected services
Use the custom ID to look up objects in "Services" assets
Complete the automation
{
"fields": {
"Affected services": [
{{#lookupObjects}}
{"id": "{{Service ID}}"}{{^last}},{{/}}
{{/}}
]
}
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I've been doing some work with the Affected Services field recently and it's a little special. It uses the OpsGenie API, not the Insight Cloud API.
You'd have to create a separate Insight Object custom field for the Services schema so that you can then set an IQL query to restrict the options. I'll call this field "Service Objects" but you can call it whatever you like.
Try this:
I'm not too sure how well this will work if multiple services are selected. Working with smart values for multiple selections gets messy, especially with Insight objects. Get it working first for a single selection then expand from there.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.