Comments
-
Yes, there is a hidden field available to the behaviour script when you create a sub-task. You can find that by starting a sub-task creation screen and examining the network traffic from your browser's developer panel. There you will see a field sent to scriptrunner called parentIssueId. From that, you get derive an issue…
-
The best way is to first run this re-import in a separate non-prod environment. Otherwise, just make sure the field that you flag as "identifier" in the import configuration is populated with unique values in both the current insight data and the import source.
-
For system fields (as opposed to custom fields), I think it's best (and perhaps necessary) to use "getFieldById()" In this case, it would be something like this (untested) def resolution = getFieldById( 'resolution' ).value if (resolution == "Duplicate" ){ getFieldById("issuelinks").setRequired( true ) } Or possibly def…
-
Yes, if you have your data already imported and employee id is currently stored in a text attribute, you can create a new object reference attribute and then modify your import configuration to populate the new attribute with an appropriate reference. As long as correctly specify the identity key, the import will only…
-
I'm not great at regex either. Have you tried to validated your pattern in a site like regeex101.com? You'll need to escape the $ too or change the string delimiter try these variants: * /[a-zA-z\/]+[^;]\$}/ * '''[a-zA-z\/]+[^;]$}''' * """[a-zA-z\/]+[^;]$}""" * $/[a-zA-z\/]+[^;]$$}/$
-
Yes that will work in jira and jsm forms as well.
-
An IQL to return all the Department objects should be quite simple, it's just "objectType = Department". Running this either in the Assets/Insight Search screen, or in the InsightUtils.findObjects() method should return 3 objects. E.g. import com.qad.common.jira.utils.InsightUtils def iql = 'objectType = Department' def…
-
I set up a sample schema with 3 object types: Org, Team and Object Team contains an attribute called "Org For Team" that is a type "Object" and points to the Org object Type. Object contains both an "Org For Object" attribute (same as above, type object and points to Org) and a "Team for Object" attribute (type object and…
-
I don't have much experience with the custom pickers, but looking the the offered "Version picker" snippets I was able to construct a working sample: import com.onresolve.scriptrunner.canned.jira.fields.model.PickerOption import org.apache.commons.lang3.StringUtils def options = [ [id: 'Foo', description: 'Bar'], [id:…
-
In a workflow post-function, you can use the UserMessageUtil Either using one of the built-in methods (success, error, warning) import com.onresolve.scriptrunner.runner.util.UserMessageUtil UserMessageUtil.success("success message") Or the flag method with a custom flag import…
-
No, I still haven't figured it out (haven't tried to much, because for me, the rest/sql methods are adequate). I might check again after I upgrade to Jira 9.x / JSM 5.x (I'm still on 8.20/4.20)
-
Jira and JSM are historically very simple in terms of front-end UI dynamic behavior (e.g. showing/hiding fields on the fly based selections or conditionally populating certain fields with different values other than the global default) I use Scriptrunner Behaviour for that sort of thing.
-
I'm assuming you are planning to put a simple scripted validator on the create screen of the sub-task workflow and cause an error when users submit the sub-task if the parent has the wrong value. In which case something like this might work: import com.atlassian.jira.component.ComponentAccessor def customFieldManager =…
-
You actually can ignore the partial results in the current version. Here is a sample console script that does this: import com.onresolve.scriptrunner.ldap.LdapUtil import org.springframework.ldap.core.AttributesMapper import org.springframework.ldap.core.LdapTemplate import javax.naming.directory.Attributes import…
-
Key refers to the Key attribute (created by default for all object types along with Name, Created, and Updated). Issues only store the key of your object as a reference to the object. IQL placeholder, the value of an insight custom field returned by ${customfield_xxxx} will be the key of the selected object. So if you want…
-
Yes, scriptrunner/behaviours is really only designed to work with user-defined issue screens like Create, Edit or workflow Transition screens. It has not been extended to work on popups like Move, Link, Clone. If the debug log shows the expected list of allowed links, but if the list is not changing in the live screen,…
-
In a test instance running Scriptunner 7.10, I was able to make the script from the library run as is without any changes. The error in the editor can be alleviated by explicitly casting the allowedLinks in the last line: linkTypesField.setFieldOptions(allowedLinks as Map<String,String>) But that was not a breaking error.…
-
Assuming that customfield_11300 is another insight objects custom field, you then want to compare that against the Key attribute object HAVING inR(objectType=Systems and Key=${customerield_11300}, reftype in ("Approver")) If that doesn't work, try the following: object HAVING inR(objectType=Systems and Key…
-
You want to make sure you are not comparing apples to oranges. My read is that "Country"."Name" will be the string value of the Name attribute on the Country object. And ${customfield_13313.Country} will be an object representing the county. Is that correct? Maybe you can share a bit more about your two object types, their…
-
Pretty much everything is in the DB. Workflows are stored in the jiraworkflows and jiradraftworkflow tables. But the trick will be to filter my modified date. There is no such column in the database. Instead, you'll have to find a way to look inside the value of the "DESCRIPTOR" column with is stored as XML. You'll see a…
-
Sorry no idea why this failed before. But glad you got it all to work.
-
Looks like I had a slash in the wrong direction in this line: log.info "Making a POST Request to $webhookBase\$webhookPath \n with Payload: \n${new JsonBuilder(body).toPrettyString()}" It should be log.info "Making a POST Request to $webhookBase/$webhookPath \n with Payload: \n${new JsonBuilder(body).toPrettyString()}" But…
-
So then what's your question? I showed you how you can access all issues linked to the current/known issue. From there, you can filter or not on any aspect of an issue.
-
Then I don't think I understand your case. Your question was: how to search/get all the linked issues with the same title and type in one issue Can you expand on what you are trying to do that is not searching amongst linked issues for an issue with the same title and type?
-
Behaviour on Server/DC doesn't support JSON. Only groovy. Everything about this question was about Server/DC If you're on Cloud, you'll be better off asking a brand new question and hopefully, someone else can help you. I have no experience with Scriptrunner on Cloud.
-
This is Groovy code, not JSON. You can't unhide a field that's hidden by the system. Make sure your field is available for the current context, it has been added to the screen and is set to visible in the project field config. Then and only then will you be able to set to hidden or visible at will using your…
-
From the Custom Fields page, you can Edit a field or view the Field's configuration and you'll see the ID as part of the URL in either the edit or configure screen.
-
Hi Here is a short script you can try in the Scriptrunner console that will return the list of issues linked to issue ABC-1 where the Summary and Issue Types are the same. import com.atlassian.jira.component.ComponentAccessor def currentUser = ComponentAccessor.jiraAuthenticationContext.loggedInUser def issue =…
-
Try it like this: import com.atlassian.jira.component.ComponentAccessor import com.atlassian.jira.config.properties.APKeys import com.atlassian.jira.issue.CustomFieldManager import com.atlassian.jira.issue.Issue import com.atlassian.jira.issue.customfields.option.Option import com.atlassian.jira.issue.fields.CustomField…
-
No that line has nothing to do with the issue with the summary. I was just curious why you kept the more complex version. The problem is where your script is located. Only scripts linked to fields that are changed are executed. Add the "informacion que deseo modificar" field to the behaviour configuration and then copy…