Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Deleted user
0 / 0 points
Next:
badges earned

Your Points Tracker
Challenges
Leaderboard
  • Global
  • Feed

Badge for your thoughts?

You're enrolled in our new beta rewards program. Join our group to get the inside scoop and share your feedback.

Join group
Recognition
Give the gift of kudos
You have 0 kudos available to give
Who do you want to recognize?
Why do you want to recognize them?
Kudos
Great job appreciating your peers!
Check back soon to give more kudos.

Past Kudos Given
No kudos given
You haven't given any kudos yet. Share the love above and you'll see it here.

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Jira AbstactService properties field does not appear Edited

Hello,

 

i am trying to register a service which has a paramter field just like script runner does:

Unbenannt.PNG

I have defined a field in the properties xml file but the field does not appear.

 

XML:

<importcsvservice id="importcsvservice">
<description>Dieser Dienst importiert Sollzeiten für den Multi-Timetracker</description>
<properties>
<key>input-file</key>
<name>admin.service.fileimport.sourcefile</name>
<type>string</type>
</properties>
</importcsvservice>

Java Code:

package aptis.plugins.meetingTime.presence;
import com.atlassian.configurable.ObjectConfiguration;
import com.atlassian.configurable.ObjectConfigurationException;
import com.atlassian.jira.service.AbstractService;
import java.util.Map;

public class ImportFromFileJob extends AbstractService {

private ActiveObjects activeObjects;

@Override
public void run() {
try {
ObjectConfiguration objectConfiguration = this.getObjectConfiguration();
Map fieldValues = objectConfiguration.getFieldValues("admin.service.fileimport.sourcefile");
} catch (ObjectConfigurationException e) {
e.printStackTrace();
}
}

@Override
public ObjectConfiguration getObjectConfiguration() throws ObjectConfigurationException {
return getObjectConfiguration("importcsvservice", "xml/presence-service-properties.xml", null);
}

}

Any Ideas where the problem is?

 

Thanks in advance!

Jens 

1 answer

Hi Jens,

try to correct the service xml configuration:

<importcsvservice id="importcsvservice">
<description>Dieser Dienst importiert Sollzeiten für den Multi-Timetracker</description>
<properties>
<key>input-file</key>
<name>admin.service.fileimport.sourcefile</name>
<type>string</type>
</properties>
</importcsvservice>

to the following one (you missed the property element):

<importcsvservice id="importcsvservice">
<description>Dieser Dienst importiert Sollzeiten für den Multi-Timetracker</description>
<properties>
<property>
<key>input-file</key>
<name>admin.service.fileimport.sourcefile</name>
<type>string</type>
</property>
</properties>
</importcsvservice>

and properties can be easily accessed in the init method
public void init(PropertySet props) throws ObjectConfigurationException {
......
}
Regards Götz

Thanks for your answer, unfortunately im not working on this project any more and can't try this out (the jira instance doesnt exist any more)

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Confluence

Introducing External Collaboration for Confluence

We’re excited to introduce external collaboration for Confluence, now available in early access. It is available to preview for Confluence Cloud Premium and Enterprise customers. (If you're not on ...

173 views 0 6
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you